Skip to content

Commit

Permalink
Defer type-resolving in TernaryEmptyArrayArrayDimFetchToCoalesceRector (
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed May 7, 2023
1 parent eee943b commit 0f07aac
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ public function refactor(Node $node): ?Node
return null;
}

$emptyExprType = $this->getType($negagedExpr->expr);
if (! $emptyExprType->isArray()->yes()) {
if (! $node->if instanceof ArrayDimFetch) {
return null;
}

if (! $node->if instanceof ArrayDimFetch) {
$emptyExprType = $this->getType($negagedExpr->expr);
if (! $emptyExprType->isArray()->yes()) {
return null;
}

Expand Down

0 comments on commit 0f07aac

Please sign in to comment.