mirror of
https://github.com/danog/PHP-Parser.git
synced 2024-12-02 17:28:27 +01:00
parent
80ead71da2
commit
49d73e829f
@ -39,6 +39,8 @@ class PrintableNewAnonClassNode extends Expr
|
|||||||
public static function fromNewNode(Expr\New_ $newNode) {
|
public static function fromNewNode(Expr\New_ $newNode) {
|
||||||
$class = $newNode->class;
|
$class = $newNode->class;
|
||||||
assert($class instanceof Node\Stmt\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.
|
||||||
assert($class->name === null);
|
assert($class->name === null);
|
||||||
return new self(
|
return new self(
|
||||||
$newNode->args, $class->extends, $class->implements,
|
$newNode->args, $class->extends, $class->implements,
|
||||||
|
Loading…
Reference in New Issue
Block a user