Skip to content

Commit a07996a

Browse files
committed
OffsetAccessValueAssignmentRule optimization for huge arrays
1 parent 11e0ab6 commit a07996a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Rules/Arrays/OffsetAccessValueAssignmentRule.php

+4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ public function processNode(Node $node, Scope $scope): array
4646
}
4747

4848
$arrayDimFetch = $node->var;
49+
$varType = $scope->getType($arrayDimFetch->var);
50+
if ($varType->isObject()->no()) {
51+
return [];
52+
}
4953

5054
if ($node instanceof Assign || $node instanceof Expr\AssignRef) {
5155
$assignedValueType = $scope->getType($node->expr);

0 commit comments

Comments
 (0)