Skip to content

Add return type annotations to TransformableData trait #1000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cyppe
Copy link

@cyppe cyppe commented Apr 11, 2025

This PR adds proper PHPDoc type annotations to the methods in the TransformableData trait to improve static analysis with PHPStan. Specifically:

  • Added @return array<string, mixed> to transform(), toArray(), all(), and jsonSerialize() methods
  • These annotations accurately reflect that these methods return associative arrays with string keys and mixed values
  • Improves type safety and IDE autocompletion support
  • Helps PHPStan better understand the return types for static analysis

The changes are purely documentation improvements with no functional impact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant