Skip to content

Commit 3200c9f

Browse files
Simplify
1 parent 88ea889 commit 3200c9f

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

src/Analyser/MutatingScope.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2595,8 +2595,13 @@ public function assignVariable(string $variableName, Type $type, Type $nativeTyp
25952595
}
25962596

25972597
$assignedExpr = $expressionType->getExpr()->getAssignedExpr();
2598-
if ($assignedExpr instanceof Expr\ArrayDimFetch && $assignedExpr->var instanceof Expr\ArrayDimFetch && !$this->isNestedDimFetchPathValid($scope, $assignedExpr)) {
2599-
$invalidatedIntertwinedRefs[] = $exprString;
2598+
if (
2599+
$assignedExpr instanceof Expr\ArrayDimFetch
2600+
&& $assignedExpr->var instanceof Expr\ArrayDimFetch
2601+
&& !$this->isNestedDimFetchPathValid($scope, $assignedExpr)
2602+
) {
2603+
unset($scope->expressionTypes[$exprString]);
2604+
unset($scope->nativeExpressionTypes[$exprString]);
26002605
continue;
26012606
}
26022607

@@ -2624,12 +2629,6 @@ public function assignVariable(string $variableName, Type $type, Type $nativeTyp
26242629
$scope->getNativeType($expressionType->getExpr()->getAssignedExpr()),
26252630
);
26262631
}
2627-
2628-
}
2629-
2630-
foreach ($invalidatedIntertwinedRefs as $exprString) {
2631-
unset($scope->expressionTypes[$exprString]);
2632-
unset($scope->nativeExpressionTypes[$exprString]);
26332632
}
26342633

26352634
return $scope;

0 commit comments

Comments
 (0)