Skip to content

Commit 544b4e6

Browse files
authored
Fix phpstan notice on RepeatedOrEqualToInArrayRector (#7407)
* Fix phpstan notice on RepeatedOrEqualToInArrayRector * Fix phpstan notice on RepeatedOrEqualToInArrayRector
1 parent 3fabc95 commit 544b4e6

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

phpstan.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,3 @@ parameters:
345345
-
346346
identifier: symplify.noReference
347347
message: '#Use explicit return value over magic &reference#'
348-
349-
# known type
350-
-
351-
identifier: argument.type
352-
message: '#Parameter \#1 \$expr of method Rector\\CodeQuality\\Rector\\BooleanOr\\RepeatedOrEqualToInArrayRector\:\:matchComparedExprAndValueExpr\(\) expects PhpParser\\Node\\Expr\\BinaryOp\\Equal\|PhpParser\\Node\\Expr\\BinaryOp\\Identical, PhpParser\\Node\\Expr given#'

rules/CodeQuality/Rector/BooleanOr/RepeatedOrEqualToInArrayRector.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ private function matchComparedAndDesiredValues(BooleanOr $booleanOr): ?array
166166
return null;
167167
}
168168

169-
$comparedExprAndValueExprs[] = $this->matchComparedExprAndValueExpr($currentBooleanOr->left->right);
169+
/** @var Identical|Equal $leftRight */
170+
$leftRight = $currentBooleanOr->left->right;
171+
$comparedExprAndValueExprs[] = $this->matchComparedExprAndValueExpr($leftRight);
170172
$currentBooleanOr = $currentBooleanOr->left;
171173
}
172174

0 commit comments

Comments
 (0)