"New in initializers" breaks in docblock
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
Research direction
Start with the linked PHPStan reproducer and trace how the parser handles the @method docblock syntax involving PHP 8.1 "new in initializers." Compare it with the equivalent syntax accepted in code. Done means the docblock case parses correctly and has regression coverage for the reported example.
Written by the indexing model from the issue text.
Description
Bug report
Since PHP 8.1, it is possible to use new as default parameters ("new in initializers" RFC).
PHPStan gets it perfectly, but things stop working once we move them to docblocks, explicitly the @method docblock (see example).
Code snippet that reproduces the problem
https://phpstan.org/r/5d0cdcbb-5c11-4483-90b0-b95986f92bc2
Expected output
Since PHPStan understands the "new in initializers" in the code, I guess that this is a missed use-case instead of an actual bug, but I didn't know where to report it.
Did PHPStan help you today? Did it make you happy in any way?
Every. single. day.
Thanks for this amazing tool!
- Dominant language
- PHP
- Stars
- 1.5k
- Forks
- 78
- Avg merge
- 9h 5m
- Merged PRs (30d)
- 5
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from phpstan/phpdoc-parser
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
phpstan/phpdoc-parser#317 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
phpstan/phpdoc-parser#281 · 2 comments · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
phpstan/phpdoc-parser#271 · 1 comment · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
phpstan/phpdoc-parser#219 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
phpstan/phpdoc-parser#178 · 1 comment ·
All issues in phpstan/phpdoc-parser
Similar issues
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/fulltextsearch#1011 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
phpstan/phpstan-doctrine#794 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Automattic/static-site-importer#1767 ·