From 3fbbe3f6975775111e7a6e629626c33002c84fdb Mon Sep 17 00:00:00 2001 From: Geni Jaho Date: Thu, 17 Oct 2024 17:44:03 +0200 Subject: [PATCH] Fix rule AnonymousMigrationsRector (#260) --- src/Rector/Class_/AnonymousMigrationsRector.php | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/Rector/Class_/AnonymousMigrationsRector.php b/src/Rector/Class_/AnonymousMigrationsRector.php index 63a0b255..9e47fb6a 100644 --- a/src/Rector/Class_/AnonymousMigrationsRector.php +++ b/src/Rector/Class_/AnonymousMigrationsRector.php @@ -78,19 +78,8 @@ public function refactor(Node $node): ?Node return null; } - return new Return_(new New_(new Class_( - null, - [ - 'flags' => $node->flags, - 'extends' => $node->extends, - 'implements' => $node->implements, - 'stmts' => $node->stmts, - 'attrGroups' => $node->attrGroups, - ], - [ - 'startLine' => $node->getStartLine(), - 'endLine' => $node->getEndLine(), - ] - ))); + $node->name = null; + + return new Return_(new New_($node)); } }