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

Infer non-empty-array from the result of in_array() #6167

Closed
dktapps opened this issue Dec 7, 2021 · 3 comments · Fixed by phpstan/phpstan-src#1108
Closed

Infer non-empty-array from the result of in_array() #6167

dktapps opened this issue Dec 7, 2021 · 3 comments · Fixed by phpstan/phpstan-src#1108
Labels
Milestone

Comments

@dktapps
Copy link
Contributor

dktapps commented Dec 7, 2021

Feature request

https://phpstan.org/r/387a65ca-0be1-4402-8d5a-c18c492e0d25

The type dumped here should be non-empty-array<int, string>.

@ondrejmirtes ondrejmirtes added this to the Easy fixes milestone Dec 8, 2021
@ondrejmirtes
Copy link
Member

This is super-easy to fix in the in_array type-specifying extension.

@dktapps
Copy link
Contributor Author

dktapps commented Jan 7, 2022

I tried to fix this, but the code is really confusing and I couldn't figure out how to get it working.

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

Successfully merging a pull request may close this issue.

2 participants