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)); } }