Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Feb 1, 2022

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about '0' here? Again, you can try ->toInteger().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this code was existant before this PR and covers a different use-case.
should I change it with this PR nevertheless , or better do so in a different PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do it here :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newly added testcases in 578e96d show that division by '0' and other falsy values work as expected.
so IMO we just leave this as is, right?

@staabm staabm marked this pull request as ready for review February 1, 2022 20:40
@ondrejmirtes ondrejmirtes merged commit 39e5e0c into phpstan:master Feb 6, 2022
@ondrejmirtes
Copy link
Member

Thank you.

@staabm staabm deleted the modulo1 branch February 6, 2022 11:46
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.

modulo '1' is always 0

3 participants