Skip to content

Conversation

@cyppe
Copy link
Contributor

@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.

@rubenvanassche rubenvanassche merged commit 0cb7d1a into spatie:main Jun 20, 2025
1 check passed
@rubenvanassche
Copy link
Member

Thanks!

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.

2 participants