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

Invalid docblock in 4.17.0 for PHPParser\Node\Stmt\ClassConst #939

Closed
weirdan opened this issue Aug 13, 2023 · 1 comment
Closed

Invalid docblock in 4.17.0 for PHPParser\Node\Stmt\ClassConst #939

weirdan opened this issue Aug 13, 2023 · 1 comment

Comments

@weirdan
Copy link

weirdan commented Aug 13, 2023

4.17.0 introduced $type property in PHPParser\Node\Stmt\ClassConst. However, docblock types for the constructor parameter and the property itself are not compatible. Constructor accepts null|string|...:

* @param null|string|Node\Identifier|Node\Name|Node\ComplexType $type Type declaration

then assigns it directly to the property. But the property does not accept neither null nor string:

/** @var Node\Identifier|Node\Name|Node\ComplexType Type declaration */

@nikic
Copy link
Owner

nikic commented Aug 13, 2023

Thanks for catching, looks like a mistake was introduced in the backport from the master branch. I've tagged 4.17.1 with a fix.

weirdan added a commit to weirdan/psalm that referenced this issue Aug 13, 2023
`4.17.0` had a bug that made our CI checks to fail. `4.17.1` fixed that
issue (nikic/PHP-Parser#939).
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