@@ -239,7 +239,7 @@ public function specifyTypesInCondition(
239239 && count ($ expr ->right ->getArgs ()) === 1
240240 && $ expr ->right ->name instanceof Name
241241 && in_array (strtolower ((string ) $ expr ->right ->name ), ['count ' , 'sizeof ' ], true )
242- && ( new IntegerType ())-> isSuperTypeOf ( $ leftType )->yes ()
242+ && $ leftType -> isInteger ( )->yes ()
243243 ) {
244244 if (
245245 $ context ->truthy () && (IntegerRangeType::createAllGreaterThanOrEqualTo (1 - $ offset )->isSuperTypeOf ($ leftType )->yes ())
@@ -258,7 +258,7 @@ public function specifyTypesInCondition(
258258 && count ($ expr ->right ->getArgs ()) === 1
259259 && $ expr ->right ->name instanceof Name
260260 && strtolower ((string ) $ expr ->right ->name ) === 'strlen '
261- && ( new IntegerType ())-> isSuperTypeOf ( $ leftType )->yes ()
261+ && $ leftType -> isInteger ( )->yes ()
262262 ) {
263263 if (
264264 $ context ->truthy () && (IntegerRangeType::createAllGreaterThanOrEqualTo (1 - $ offset )->isSuperTypeOf ($ leftType )->yes ())
@@ -1646,12 +1646,10 @@ public function resolveEqual(Expr\BinaryOp\Equal $expr, Scope $scope, TypeSpecif
16461646 return $ this ->create ($ expr ->left , new NonEmptyArrayType (), $ context ->negate (), false , $ scope , $ rootExpr );
16471647 }
16481648
1649- $ integerType = new IntegerType ();
1650- $ floatType = new FloatType ();
16511649 if (
16521650 ($ leftType ->isString ()->yes () && $ rightType ->isString ()->yes ())
1653- || ($ integerType -> isSuperTypeOf ( $ leftType )->yes () && $ integerType -> isSuperTypeOf ( $ rightType )->yes ())
1654- || ($ floatType -> isSuperTypeOf ( $ leftType )->yes () && $ floatType -> isSuperTypeOf ( $ rightType )->yes ())
1651+ || ($ leftType -> isInteger ( )->yes () && $ rightType -> isInteger ( )->yes ())
1652+ || ($ leftType -> isFloat ( )->yes () && $ rightType -> isFloat ( )->yes ())
16551653 || ($ leftType ->isEnum ()->yes () && $ rightType ->isEnum ()->yes ())
16561654 ) {
16571655 return $ this ->specifyTypesInCondition ($ scope , new Expr \BinaryOp \Identical ($ expr ->left , $ expr ->right ), $ context , $ rootExpr );
0 commit comments