Skip to content

Commit e302961

Browse files
ondrejmirtesherndlm
authored andcommitted
I hate this hack but it works
1 parent 91de2db commit e302961

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Rules/Comparison/ImpossibleCheckTypeHelper.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@ public function findSpecifiedType(
199199
return null;
200200
}
201201

202+
if ($rootExpr instanceof Expr\BinaryOp) {
203+
if ($isSpecified($rootExpr->left) || $isSpecified($rootExpr->right)) {
204+
return null;
205+
}
206+
}
207+
202208
$rootExprType = $scope->getType($rootExpr);
203209
if ($rootExprType instanceof ConstantBooleanType) {
204210
return $rootExprType->getValue();

0 commit comments

Comments
 (0)