-
Notifications
You must be signed in to change notification settings - Fork 474
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
Test loose comparison on constant types #3755
Conversation
4db6522
to
9e3d1d3
Compare
assertType('false', 5 == $emptyStr); | ||
assertType('false', 5 == $phpStr); | ||
assertType('false', 5 == 'a'); | ||
|
||
assertType('false', $emptyStr == 5); | ||
assertType('false', $phpStr == 5); | ||
assertType('false', 'a' == 5); |
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.
if ($this->isIterableAtLeastOnce()->no() && count($type->getConstantScalarValues()) === 1) { | ||
// @phpstan-ignore equal.invalid, equal.notAllowed | ||
return new ConstantBooleanType($type->getConstantScalarValues()[0] == []); // phpcs:ignore | ||
if ($type->isInteger()->yes()) { |
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.
mirrored from ArrayType
a85f37a
to
6fcbe71
Compare
assertType('false', $emptyArr == $looseOne); | ||
assertType('bool', $emptyArr == $constMix); | ||
assertType('bool', $emptyArr == $looseZero); |
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.
Thank you. |
No description provided.