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
Enforce optional parameters in callable types #1354
Conversation
The test assertions from the failures probably need updating, otherwise 👍 :) |
1 similar comment
The test assertions from the failures probably need updating, otherwise 👍 :) |
07d01e2
to
d091d74
Compare
Thank you! |
It's so annoying but I have to revert this. In a test project I'm running each new PHPStan commit on, this change caused 81 new errors. And it's because of these annotations in doctrine/collections (the same mistake is repeated above multiple methods):
This means that passing |
So some research needs to be done:
|
Also there's number of issues phpstan-bot commented on because playground samples changed. All of this tells me impact on the ecosystem would be too huge even if we're right. Might be better to save a fix like this for a major version. |
I think most of the issues the bot found were due to the I'll research this for a bit soon. |
Psalm does not consider this to be an issue, but I think it's pretty clear that it is. I believe the annotations in Doctrine Collections are wrong. Specifically: However, I agree that this change could be overly disruptive. An option might be to put it in |
Can you please open a Psalm issue to see what the maintainers think about this? Thanks :) Bleeding edge - I considered it, but this is deep in the typesystem so there would have to be some kind of global static singleton toggle to query... (There was once in the past for similar purpose). |
FYI |
FYI, I opened the psalm issue at vimeo/psalm#8438 |
Readded this again: 45404d9 |
Fixes phpstan/phpstan#7320