File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
tests/PHPStan/Analyser/nsrt Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -249,6 +249,10 @@ public function isConstantValue(): TrinaryLogic
249249
250250 public function looseCompare (Type $ type , PhpVersion $ phpVersion ): BooleanType
251251 {
252+ if ($ type ->isInteger ()->yes ()) {
253+ return new ConstantBooleanType (false );
254+ }
255+
252256 return new BooleanType ();
253257 }
254258
Original file line number Diff line number Diff line change @@ -701,11 +701,17 @@ public function sayConstUnion(
701701 /**
702702 * @param uppercase-string $upper
703703 * @param lowercase-string $lower
704+ * @param non-empty-array $nonEmptyArr
705+ * @param int<10, 20> $intRange
704706 */
705707 public function sayIntersection (
706708 string $ upper ,
707709 string $ lower ,
708710 string $ s ,
711+ array $ nonEmptyArr ,
712+ array $ arr ,
713+ int $ i ,
714+ int $ intRange ,
709715 ): void
710716 {
711717 assertType ('bool ' , '' == $ upper );
@@ -731,7 +737,11 @@ public function sayIntersection(
731737 assertType ('bool ' , strtoupper ($ s ) == $ lower ); // should be false
732738 assertType ('bool ' , strtolower ($ s ) == $ lower );
733739 assertType ('bool ' , $ lower == $ upper ); // should be false
734- }
735740
741+ assertType ('false ' , $ arr == $ i );
742+ assertType ('false ' , $ nonEmptyArr == $ i );
743+ assertType ('false ' , $ arr == $ intRange );
744+ assertType ('false ' , $ nonEmptyArr == $ intRange );
745+ }
736746
737747}
You can’t perform that action at this time.
0 commit comments