Skip to content

Conversation

@yoeunes
Copy link
Member

@yoeunes yoeunes commented Oct 13, 2024

This pull request introduces significant improvements to the codebase’s type safety, static analysis, and IDE support by:

•	Adding Detailed PHPDoc Annotations: Updated classes and methods with comprehensive PHPDoc comments, including precise parameter and return types. Leveraged advanced annotations such as @template, @phpstan-type, conditional types, and method-level generics to provide explicit type information.
•	Implementing Stricter PHPStan Validations: Configured PHPStan with stricter rules to catch potential type errors and inconsistencies. Fixed various PHPStan errors by aligning method signatures with PHPDoc annotations and ensuring type compatibility across the codebase.
•	Fixing Type Mismatches and Errors: Resolved issues where PHPStan reported type mismatches, especially related to template types and return types in methods. Adjusted method signatures and annotations to ensure consistency and correctness.
•	Enhancing IDE Support (PhpStorm): Improved autocompletion and type inference in PhpStorm by:
•	Using @phpstan-import-type annotations correctly at the file level.
•	Defining custom types with @phpstan-type for better IDE recognition.
•	Adjusting PHPDoc comments to align with PhpStorm’s parsing capabilities.

@yoeunes yoeunes merged commit aca7192 into 2.x Oct 13, 2024
@yoeunes yoeunes deleted the phpstan branch October 13, 2024 20:42
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