Skip to content

Commit 290b5c7

Browse files
authored
ensure reset args after loop (#864)
1 parent 50c07e7 commit 290b5c7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rules/CodeQuality/Rector/Class_/InlineClassRoutePrefixRector.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,11 @@ public function refactor(Node $node): ?Class_
234234
// silent or "path"
235235
if ($attributeArg->name === null || $attributeArg->name->toString() === self::PATH) {
236236
unset($attribute->args[$attributeArgKey]);
237-
$attribute->args = array_values($attribute->args);
238237
}
239238
}
240239

240+
$attribute->args = array_values($attribute->args);
241+
241242
// nothing to keep, remove whole attribute
242243
if ($attribute->args === []) {
243244
unset($attrGroup->attrs[$attributeKey]);

0 commit comments

Comments
 (0)