Skip to content

Commit

Permalink
Disambiguate && / || operator priority
Browse files Browse the repository at this point in the history
  • Loading branch information
herndlm authored and ondrejmirtes committed Jul 10, 2022
1 parent 2b20335 commit 135bc57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Analyser/TypeSpecifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public function specifyTypesInCondition(
$exprLeftType = $scope->getType($expr->left);
$exprRightType = $scope->getType($expr->right);
if (
$exprLeftType instanceof ConstantType && !$exprRightType->equals($exprLeftType) && $exprRightType->isSuperTypeOf($exprLeftType)->yes()
($exprLeftType instanceof ConstantType && !$exprRightType->equals($exprLeftType) && $exprRightType->isSuperTypeOf($exprLeftType)->yes())
|| $exprLeftType instanceof EnumCaseObjectType
) {
$types = $this->create(
Expand All @@ -318,7 +318,7 @@ public function specifyTypesInCondition(
);
}
if (
$exprRightType instanceof ConstantType && !$exprLeftType->equals($exprRightType) && $exprLeftType->isSuperTypeOf($exprRightType)->yes()
($exprRightType instanceof ConstantType && !$exprLeftType->equals($exprRightType) && $exprLeftType->isSuperTypeOf($exprRightType)->yes())
|| $exprRightType instanceof EnumCaseObjectType
) {
$leftType = $this->create(
Expand Down

0 comments on commit 135bc57

Please sign in to comment.