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

Check incompatible operand values for greater/smaller operands #217

Open
wants to merge 13 commits into
base: 1.5.x
Choose a base branch
from

Conversation

kamil-zacek
Copy link
Contributor

No description provided.

@kamil-zacek kamil-zacek force-pushed the unsupported-value-lt-gt branch 9 times, most recently from 81ae0c3 to 7b569cc Compare June 27, 2023 14:56
…an value for greater / smaller comparison is not allowed).
@kamil-zacek kamil-zacek force-pushed the unsupported-value-lt-gt branch from 7b569cc to 47a3db0 Compare June 27, 2023 15:12
@janedbal
Copy link

janedbal commented Sep 1, 2023

Here is a more generic approach: https://github.com/shipmonk-rnd/phpstan-rules#allowcomparingonlycomparabletypes

Denies using comparison operators >,<,<=,>=,<=> over anything other than int|string|float|DateTimeInterface. Null is not allowed.
Mixing different types in those operators is also forbidden, only exception is comparing floats with integers

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.

3 participants