Skip to content

Commit 106c760

Browse files
authored
Add check for append in foreach items assignment
1 parent 13f7abd commit 106c760

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

rules/CodeQuality/Rector/Foreach_/ForeachItemsAssignToEmptyArrayToAssignRector.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ public function refactor(Node $node): ?Node
104104
}
105105

106106
if ($this->shouldSkip($stmt, $emptyArrayVariables)) {
107+
if ($this->isAppend($stmt, $emptyArrayVariables)) {
108+
return null;
109+
}
110+
107111
continue;
108112
}
109113

0 commit comments

Comments
 (0)