-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PropertyInfo] Handle collection in PhpStan same as PhpDoc #57617
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
[PropertyInfo] Handle collection in PhpStan same as PhpDoc #57617
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not completely convinced that allowing subclasses in #52699 was a good decision as it rather looks like introducing a new feature in a patch release. But now that we did it for the PhpDocTypeHelper
updating the PhpStanTypeHelper
in the same way looks reasonable to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
once CS fixed
src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php
Outdated
Show resolved
Hide resolved
80a81f6
to
f098683
Compare
Thank you @mtarld. |
This change ensures that the tests that have been added in symfony#57617 are also applied when the types from the TypeInfo component are used instead of the Type class that is built into the PropertyInfo component.
This PR was merged into the 7.1 branch. Discussion ---------- [PropertyInfo] add tests for TypeInfo types | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT This change ensures that the tests that have been added in #57617 are also applied when the types from the TypeInfo component are used instead of the Type class that is built into the PropertyInfo component. Commits ------- 93d3209 add tests for TypeInfo types
On #52699, a comment suggested to support classes that inherit from collection classes (such as doctrine collections for example).
This has been done for PHPDoc, but not in PHPStan.
This PR adds this missing behavior to PHPStan (and adds the missing PHPDoc related test).