Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Serializer] [PropertyAccessor] Ignore non-collection interface generics#52699
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
nicolas-grekas commentedNov 23, 2023
What about considering this as an improvement and merging into 6.4? Then we can do the BC break in 7.0. |
mtarld commentedNov 24, 2023
It also means that it won't be supported in 6.3 and 7.0 (supposing that the |
a170c98 to788659fCompare788659f toa59732fComparea59732f toeaac5c8Compareeaac5c8 to7f06cacCompare7f06cac to487b24cCompareUh oh!
There was an error while loading.Please reload this page.
fabpot commentedJun 9, 2024
Thank you@mtarld. |
xabbuh commentedJun 25, 2024
@mtarld I have merged these changes up to the |
mtarld commentedJun 26, 2024
This PR was merged into the 7.1 branch.Discussion----------[PropertyInfo] Fix generics related test| Q | A| ------------- | ---| Branch? | 7.1| Bug fix? | yes| New feature? | no <!-- please update src/**/CHANGELOG.md files -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Issues || License | MITUpdate tests accordingly to#52699 (in the same way as the legacy tests).Commits-------9245561 [PropertyInfo] Fix generics related test
soyuka commentedJul 1, 2024
HI, since that we're observing a
|
andyexeter commentedJul 3, 2024
… (mtarld)This PR was merged into the 5.4 branch.Discussion----------[PropertyInfo] Handle collection in PhpStan same as PhpDoc| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | yes| New feature? | no <!-- please update src/**/CHANGELOG.md files -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Issues |Fix#52699 (comment)| License | MITOn#52699, a [comment](#52699 (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).Commits-------f098683 [PropertyInfo] Handle collection in PhpStan same as PhpDoc
Uh oh!
There was an error while loading.Please reload this page.
PhpDocExtractorandPhpStanDocExtractorare following an old version of PSR-5 with used to define collections as the following:But, it does conflict with non-collection generics.
This issue will automatically be solved if the
TypeInfois merged in Symfony. But for older versions (<7.1 at least), it needs a fix.I was not able to find a proper bug fix without introducing a BC break, so this PR proposes to opt-on the "non-collection generics" parsing, such asstcClass<int>for example.To opt-out from parsing these generics, it'll be required to setignore_docblock_genericsin the context. And this key/value will become obsolete as soon as theTypeInfois introduced.I'm not sure how to proceed though, should we only merge it in 5.4, and 6.3 supposing that theTypeInfomight be merged in 7.x? Should we document it only in these branches?EDIT: I finally ignored PHPDoc generics that aren't well known collection generic types so that the process will fall back to other resolvers (such as reflection resolver for example)