-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
PhpStanExtractor
doesn't support docblock from promoted properties
#52682
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
Labels
Comments
nicolas-grekas
added a commit
that referenced
this issue
Nov 24, 2023
…`PhpStanExtractor` (LastDragon-ru) This PR was squashed before being merged into the 6.3 branch. Discussion ---------- [PropertyInfo] Fixed promoted property type detection for `PhpStanExtractor` | Q | A | ------------- | --- | Branch? | 6.3 <!-- see below --> | 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 #52682 <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT Implementation aligned with actual phpstan behaviour, please see https://phpstan.org/r/8278f037-5a67-4e53-8352-a13585d2eca5 <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Commits ------- 430ec79 [PropertyInfo] Fixed promoted property type detection for `PhpStanExtractor`
LastDragon-ru
added a commit
to LastDragon-ru/lara-asp
that referenced
this issue
Nov 30, 2023
LastDragon-ru
added a commit
to LastDragon-ru/lara-asp-serializer
that referenced
this issue
Nov 30, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Symfony version(s) affected
6.1+
Description
Promoted properties may have a doc comment, so the following code (see https://3v4l.org/csbKl):
will dump:
Phpstan itself also reads the type from the promoted property correctly (see https://phpstan.org/r/6de7935b-1d48-49bc-afd2-5748ec5523ac):
But the
PhpStanExtractor
ignores the property comment and always tried to use__construct
comment:symfony/src/Symfony/Component/PropertyInfo/Extractor/PhpStanExtractor.php
Lines 239 to 243 in 37f04cf
How to reproduce
Possible Solution
#52684
Additional Context
#46056
The text was updated successfully, but these errors were encountered: