Chris@13: args = $args; Chris@13: $this->extends = $extends; Chris@13: $this->implements = $implements; Chris@13: $this->stmts = $stmts; Chris@13: } Chris@13: Chris@13: public static function fromNewNode(Expr\New_ $newNode) { Chris@13: $class = $newNode->class; Chris@13: assert($class instanceof Node\Stmt\Class_); Chris@17: // We don't assert that $class->name is null here, to allow consumers to assign unique names Chris@17: // to anonymous classes for their own purposes. We simplify ignore the name here. Chris@13: return new self( Chris@13: $newNode->args, $class->extends, $class->implements, Chris@13: $class->stmts, $newNode->getAttributes() Chris@13: ); Chris@13: } Chris@13: Chris@13: public function getType() : string { Chris@13: return 'Expr_PrintableNewAnonClass'; Chris@13: } Chris@13: Chris@13: public function getSubNodeNames() : array { Chris@13: return ['args', 'extends', 'implements', 'stmts']; Chris@13: } Chris@13: }