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

Parameter #1 ...$enums of method Entity::setEnums() expects Enum, static(BaseEnum) given. #4213

Closed
vitkutny opened this issue Dec 9, 2020 · 2 comments
Labels
Milestone

Comments

@vitkutny
Copy link

vitkutny commented Dec 9, 2020

Bug report

Static type of enum class is not recognized correctly when used through array_map function. Error appeared after update from 0.12.25 to 0.12.59.

Code snippet that reproduces the problem

https://phpstan.org/r/c3cb9d99-758c-4111-8eff-87aeec52ead2

Expected output

No errors!

@ondrejmirtes ondrejmirtes added this to the Easy fixes milestone Dec 9, 2020
@phpstan-bot
Copy link
Contributor

@vitkutny After the latest commit in dev-master, PHPStan now reports different result with your code snippet:

@@ @@
-38: Parameter #1 ...$enums of method Entity::setEnums() expects Enum, static(BaseEnum) given.
-43: Parameter #1 $enums of method Entity::setEnumsWithoutSplat() expects array<Enum>, array<int, static(BaseEnum)> given.
+No errors

@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 Apr 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants