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

Optional callable parameters are not enforced #7320

Closed
5lava opened this issue May 26, 2022 · 5 comments · Fixed by phpstan/phpstan-src#1354
Closed

Optional callable parameters are not enforced #7320

5lava opened this issue May 26, 2022 · 5 comments · Fixed by phpstan/phpstan-src#1354

Comments

@5lava
Copy link

5lava commented May 26, 2022

Bug report

PHPStan does not enforce callable parameters to be optional to match the expected callable signature declared in PHPDoc.

Code snippet that reproduces the problem

https://phpstan.org/r/6323d45a-fbf0-4f3a-a150-e7ce34fb39d1

Expected output

Parameter #1 $c of function foo expects callable(int=): void, Closure(int): void given.

Did PHPStan help you today? Did it make you happy in any way?

You make the world a better place.

@ondrejmirtes
Copy link
Member

Had to revert the fix: phpstan/phpstan-src#1354

@stof
Copy link
Contributor

stof commented Aug 27, 2022

@ondrejmirtes the phpdoc in doctrine/collections is now fixed in doctrine/collections#323

So this could be re-applied once the fix is tagged.

@stof
Copy link
Contributor

stof commented Aug 27, 2022

And this is now released: https://github.com/doctrine/collections/releases/tag/1.7.2

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src#1354

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants