Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PrintableNewAnonClassNode.php

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\Internal

Code

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal