rector/rules/DowngradePhp70/NodeFactory/ClassFromAnonymousFactory.php
2021-05-10 22:23:08 +00:00

14 lines
511 B
PHP

<?php
declare (strict_types=1);
namespace Rector\DowngradePhp70\NodeFactory;
use PhpParser\Node\Stmt\Class_;
final class ClassFromAnonymousFactory
{
public function create(string $className, \PhpParser\Node\Stmt\Class_ $newClass) : \PhpParser\Node\Stmt\Class_
{
return new \PhpParser\Node\Stmt\Class_($className, ['flags' => $newClass->flags, 'extends' => $newClass->extends, 'implements' => $newClass->implements, 'stmts' => $newClass->stmts, 'attrGroups' => $newClass->attrGroups]);
}
}