-
Notifications
You must be signed in to change notification settings - Fork 541
Narrow array on count(), string on strlen() with positive-int #3373
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
Conversation
src/Analyser/TypeSpecifier.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved this 2 if-blocks out of specifyTypesForConstantBinaryExpression
as we no longer check for a constant type operand, but do a more general isInteger
based handling, which includes unbound IntegerRangeType
.
src/Analyser/TypeSpecifier.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compensated the now passed in maybe unbound IntegerRangeType
s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I did a mistake here in previous PR, as the array can still be empty in the else branch
This pull request has been marked as ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too many changes. I can't read that diff. Please send this in smaller chunks.
closes phpstan/phpstan#11558