Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
xabbuh left a comment
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 thePhpDocTypeHelper updating thePhpStanTypeHelper in the same way looks reasonable to me.
chalasr left a comment
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 OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
80a81f6 tof098683Comparexabbuh commentedJul 6, 2024
Thank you@mtarld. |
This change ensures that the tests that have been added insymfony#57617 arealso applied when the types from the TypeInfo component are used insteadof 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 | MITThis 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, acomment 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).