-
Notifications
You must be signed in to change notification settings - Fork 27
Support eq and notEq #126
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
Support eq and notEq #126
Conversation
Please add some tests that might trick the current implementation and the problems we're trying to solve, like $a == $a (always true) and also createStdClass() == createStdClass() (not always true). Thanks 😊 |
added some more tests, but I'm not entirely sure what I'm finding here and what is expected and what not. I think this needs a double-check from you :) And while looking at https://www.php.net/manual/en/language.operators.comparison.php I think we could come up with more weird constant comparisons where type-juggling is involved, like |
Btw. I'm going to add more impossible-check tests for |
I'm surprised that "with 1 and true will always evaluate to true" is even detected.
3cb2670
to
d3c0d4d
Compare
There's still one failure and I have no idea why. |
Alright ,the error "+54: Call to static method Webmozart\Assert\Assert::eq() with stdClass and mixed will always evaluate to true." should not be reported, but the root issue here is that PHPStan actually doesn't see the function declaration, because it's not loaded. Please rewrite these tests to use classes+methods, it's more reliable (and you don't have to |
Thank you! |
I don't think they add much value, but why not.
Maybe that loosely type narrowing helps prevent errors somewhere :)