Skip to content

Fix array and iterable type action methods on NeverType #1968

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

Merged
merged 1 commit into from
Nov 5, 2022

Conversation

herndlm
Copy link
Contributor

@herndlm herndlm commented Nov 4, 2022

What does he mean with that cryptic title again?
Basically, methods that work on the type / modify it instead of only describing its characteristics should not magically turn *NEVER* into mixed. Things like popArray() or shiftArray() for example.

And to be on the safe side and avoid similar future failures here I removed usage of the two relevant traits completely.

Closes phpstan/phpstan#8277

Verified

This commit was signed with the committer’s verified signature. The key has expired.
ondrejmirtes Ondřej Mirtes
@ondrejmirtes ondrejmirtes merged commit 7a7b386 into phpstan:1.9.x Nov 5, 2022
@ondrejmirtes
Copy link
Member

Nice, thank you!

@herndlm herndlm deleted the fix-8277 branch November 5, 2022 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[1.9.0] count() return type is 1 in a loop where the value changes at each iteration
2 participants