function PrintableNewAnonClassNode::fromNewNode
1 call to PrintableNewAnonClassNode::fromNewNode()
- PrettyPrinterAbstract::p in vendor/
nikic/ php-parser/ lib/ PhpParser/ PrettyPrinterAbstract.php - Pretty prints a node.
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ Internal/ PrintableNewAnonClassNode.php, line 53
Class
- PrintableNewAnonClassNode
- This node is used internally by the format-preserving pretty printer to print anonymous classes.
Namespace
PhpParser\InternalCode
public static function fromNewNode(Expr\New_ $newNode) : self {
$class = $newNode->class;
assert($class instanceof Node\Stmt\Class_);
// We don't assert that $class->name is null here, to allow consumers to assign unique names
// to anonymous classes for their own purposes. We simplify ignore the name here.
return new self($class->attrGroups, $class->flags, $newNode->args, $class->extends, $class->implements, $class->stmts, $newNode->getAttributes());
}