Skip to content

Commit 7a07852

Browse files
staabmondrejmirtes
authored andcommitted
Prevent unnecesary calls to isSuperTypeOf
1 parent ab74e58 commit 7a07852

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Reflection/InitializerExprTypeResolver.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,9 +1350,7 @@ public function resolveIdenticalType(Type $leftType, Type $rightType): BooleanTy
13501350
return new ConstantBooleanType($leftTypeFiniteTypes[0]->equals($rightTypeFiniteType[0]));
13511351
}
13521352

1353-
$isLeftSupertype = $leftType->isSuperTypeOf($rightType);
1354-
$isRightSupertype = $rightType->isSuperTypeOf($leftType);
1355-
if ($isLeftSupertype->no() && $isRightSupertype->no()) {
1353+
if ($leftType->isSuperTypeOf($rightType)->no() && $rightType->isSuperTypeOf($leftType)->no()) {
13561354
return new ConstantBooleanType(false);
13571355
}
13581356

0 commit comments

Comments
 (0)