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

Wrong Parameter #3 $x ... of method B::foo() should be contravariant with parameter $x ... of method A::foo() #10942

Open
mvorisek opened this issue Apr 26, 2024 · 0 comments
Labels
Milestone

Comments

@mvorisek
Copy link
Contributor

mvorisek commented Apr 26, 2024

Bug report

The method signatures are exactly the same. The narrowed type from phpdoc is correctly propagated to the child method, but with unexpected "should be contravariant" PHPStan error.

Code snippet that reproduces the problem

https://phpstan.org/r/42a78688-a088-4b7a-95ac-426b82d5ef4e

Expected output

no error

@ondrejmirtes ondrejmirtes added this to the Easy fixes milestone Apr 26, 2024
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