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

Breadcrumb

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

class New_

Hierarchy

  • class \PhpParser\NodeAbstract implements \PhpParser\Node, \PhpParser\JsonSerializable
    • class \PhpParser\Node\Expr extends \PhpParser\NodeAbstract
      • class \PhpParser\Node\Expr\CallLike extends \PhpParser\Node\Expr
        • class \PhpParser\Node\Expr\New_ extends \PhpParser\Node\Expr\CallLike

Expanded class hierarchy of New_

2 files declare their use of New_
ComplexityCalculatingVisitor.php in vendor/sebastian/complexity/src/Visitor/ComplexityCalculatingVisitor.php
InstantiationOfDeprecatedClassRule.php in vendor/phpstan/phpstan-deprecation-rules/src/Rules/Deprecations/InstantiationOfDeprecatedClassRule.php

File

vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php, line 10

Namespace

PhpParser\Node\Expr
View source
class New_ extends CallLike {
    
    /** @var Node\Name|Expr|Node\Stmt\Class_ Class name */
    public Node $class;
    
    /** @var array<Arg|VariadicPlaceholder> Arguments */
    public array $args;
    
    /**
     * Constructs a function call node.
     *
     * @param Node\Name|Expr|Node\Stmt\Class_ $class Class name (or class node for anonymous classes)
     * @param array<Arg|VariadicPlaceholder> $args Arguments
     * @param array<string, mixed> $attributes Additional attributes
     */
    public function __construct(Node $class, array $args = [], array $attributes = []) {
        $this->attributes = $attributes;
        $this->class = $class;
        $this->args = $args;
    }
    public function getSubNodeNames() : array {
        return [
            'class',
            'args',
        ];
    }
    public function getType() : string {
        return 'Expr_New';
    }
    public function getRawArgs() : array {
        return $this->args;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
CallLike::getArgs public function Assert that this is not a first-class callable and return only ordinary Args.
CallLike::isFirstClassCallable public function Returns whether this call expression is actually a first class callable.
New_::$args public property @var array&lt;Arg|VariadicPlaceholder&gt; Arguments
New_::$class public property @var Node\Name|Expr|Node\Stmt\Class_ Class name
New_::getRawArgs public function Return raw arguments, which may be actual Args, or VariadicPlaceholders for first-class
callables.
Overrides CallLike::getRawArgs
New_::getSubNodeNames public function
New_::getType public function
New_::__construct public function Constructs a function call node.

API Navigation

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