diff --git a/rules/CodeQuality/Rector/Class_/InlineClassRoutePrefixRector.php b/rules/CodeQuality/Rector/Class_/InlineClassRoutePrefixRector.php index 0a4d2a8cc..e12c9b4aa 100644 --- a/rules/CodeQuality/Rector/Class_/InlineClassRoutePrefixRector.php +++ b/rules/CodeQuality/Rector/Class_/InlineClassRoutePrefixRector.php @@ -234,10 +234,11 @@ public function refactor(Node $node): ?Class_ // silent or "path" if ($attributeArg->name === null || $attributeArg->name->toString() === self::PATH) { unset($attribute->args[$attributeArgKey]); - $attribute->args = array_values($attribute->args); } } + $attribute->args = array_values($attribute->args); + // nothing to keep, remove whole attribute if ($attribute->args === []) { unset($attrGroup->attrs[$attributeKey]);