Skip to content
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

"New in initializers" breaks in docblock #173

Open
juampi92 opened this issue Dec 22, 2022 · 1 comment
Open

"New in initializers" breaks in docblock #173

juampi92 opened this issue Dec 22, 2022 · 1 comment

Comments

@juampi92
Copy link

juampi92 commented Dec 22, 2022

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!

@ondrejmirtes
Copy link
Member

That's a completely different code path, because it has to be implemented in phpdoc-parser.

@ondrejmirtes ondrejmirtes transferred this issue from phpstan/phpstan Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants