Skip to content

Commit 250b416

Browse files
committed
Revert "avoid invalid append"
This reverts commit d2d205f.
1 parent d2d205f commit 250b416

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

rules/DowngradePhp74/Rector/Array_/DowngradeArraySpreadRector.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,22 +194,15 @@ private function refactorArrayConstValue(Array_ $array): ?Array_
194194

195195
$constants = $classLike->getConstants();
196196

197-
$hasChangedOnCurrentIteration = false;
198197
foreach ($constants as $constant) {
199198
$const = $constant->consts[0];
200199

201200
if ($const->name->toString() === $name->toString() && $const->value instanceof Array_) {
202201
$newArray->items = array_merge($newArray->items, $const->value->items);
203202

204203
$hasChanged = true;
205-
$hasChangedOnCurrentIteration = true;
206204
}
207205
}
208-
209-
if (! $hasChangedOnCurrentIteration) {
210-
$newArray->items[] = $item;
211-
}
212-
213206
}
214207

215208
if ($hasChanged) {

0 commit comments

Comments
 (0)