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

param-immediately-invoked-callable should be usable for parameters with a Closure type #10899

Closed
stof opened this issue Apr 18, 2024 · 2 comments
Labels

Comments

@stof
Copy link
Contributor

stof commented Apr 18, 2024

Bug report

Adding @param-immediately-invoked-callable $c in phpdoc seems to create an implicit @param callable $c parameter even though it does not exist in the phpdoc, which is then reported as being incompatible with the native type.

Either the implicit tag should make a better guess for the type by using the native type (or an intersection of the native type and callable) or the implicit type should be excluded from the rule checking compatibility.

Code snippet that reproduces the problem

https://phpstan.org/r/000fd2ae-c728-4013-a5c7-6a9dd6b846fe

Expected output

No error being reported about an invalid @param tag which does not exist.

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

No response

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src@6277fb4

Currently there are no errors reported about @param-closure-this, @param-immediately-invoked-callable, @param-later-invoked-callable.

They can be introduced in new rules.

@stof
Copy link
Contributor Author

stof commented Apr 25, 2024

I created #10932 as a feature request for such new rule, so that it is tracked (maybe someone will want to contribute it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants