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

Having many class constants triggers error #5447

Closed
Mika- opened this issue Aug 9, 2021 · 5 comments
Closed

Having many class constants triggers error #5447

Mika- opened this issue Aug 9, 2021 · 5 comments

Comments

@Mika-
Copy link

Mika- commented Aug 9, 2021

Bug report

Came across this odd behavior after updating to 0.12.94.

Having many class constants leads to Array (array<string, string>) does not accept key string. in array population. Removing any one of the referenced constants in class fixes this, so it's somehow triggered by the amount and not actual content.

Code snippet that reproduces the problem

https://phpstan.org/r/a05d7319-0244-4476-9c00-2401475bb4a4

Expected output

No errors despite amount of constants.

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

PHPStan has been a great help and have loved to see it become more stable in a past year or so.

@ondrejmirtes
Copy link
Member

Thank you for your kind words! This is basically the same problem as #3555, please follow that one.

@ondrejmirtes
Copy link
Member

I managed to solve this.

Look forward to the next release (0.12.95) :)

@Mika-
Copy link
Author

Mika- commented Aug 19, 2021

Thanks for resolving this quickly. It was a pretty annoying problem with a codebase that uses heavily constant enums.

@ondrejmirtes
Copy link
Member

No problem! Feel free to show your support by sponsoring my account or PHPStan organization :) I'd really appreciate it!

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

No branches or pull requests

2 participants