-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix metadata constructor inference by phpstan #8734
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do any errors go away if you regenerate Psalm's baseline? I think PHPStan would complain if it was the case for its baseline.
PHPStan does complain. |
@orklah please review |
It's a shame to fix that in Doctrine's code but there's not much else to do... I'm quite puzzled by the tests though. I wonder if it's a good move to add tests to check that Psalm and PHPStan understand an arbitrary piece of code. I'm afraid future errors in those tests could lead to version stagnation for those tools while providing little value for the user (they will still upgrade their versions and their analysis will still be broken). I'd much rather see PHPStan and Psalm add doctrine to their own CI instead (Psalm already does this for a few libraries that relies on static analysis) |
About the tests, this approach was suggested by both beberlei and Ocramius, see #8709 (comment) . IMO it's good to test that the annotations we write are correct and don't break downstream projects. As for the deps stagnation, I'm not too worried about it, I think we will regularly upgrade just like we do now, to get bugfixes. |
Thanks @VincentLanglet ! |
Close #8709