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

Breadcrumb

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

function Node::__construct

Same name in this branch
  1. 11.1.x vendor/phpunit/php-code-coverage/src/Report/Xml/Node.php \SebastianBergmann\CodeCoverage\Report\Xml\Node::__construct()
  2. 11.1.x vendor/mck89/peast/lib/Peast/Syntax/Node/Node.php \Peast\Syntax\Node\Node::__construct()
  3. 11.1.x core/modules/node/src/Plugin/migrate/source/d6/Node.php \Drupal\node\Plugin\migrate\source\d6\Node::__construct()
  4. 11.1.x core/modules/node/src/Plugin/migrate/source/d7/Node.php \Drupal\node\Plugin\migrate\source\d7\Node::__construct()
  5. 11.1.x core/modules/node/src/Plugin/views/wizard/Node.php \Drupal\node\Plugin\views\wizard\Node::__construct()
  6. 11.1.x core/modules/node/src/Plugin/views/argument_default/Node.php \Drupal\node\Plugin\views\argument_default\Node::__construct()

Parameters

array<string|int, Node> $nodes An array of named nodes:

array $attributes An array of attributes (should not be nodes):

int $lineno The line number:

92 calls to Node::__construct()
AbstractBinary::__construct in vendor/twig/twig/src/Node/Expression/Binary/AbstractBinary.php
AbstractBinary::__construct in vendor/twig/twig/src/Node/Expression/Binary/AbstractBinary.php
AbstractUnary::__construct in vendor/twig/twig/src/Node/Expression/Unary/AbstractUnary.php
AbstractUnary::__construct in vendor/twig/twig/src/Node/Expression/Unary/AbstractUnary.php
ArrayExpression::__construct in vendor/twig/twig/src/Node/Expression/ArrayExpression.php

... See full list

46 methods override Node::__construct()
AbstractBinary::__construct in vendor/twig/twig/src/Node/Expression/Binary/AbstractBinary.php
AbstractUnary::__construct in vendor/twig/twig/src/Node/Expression/Unary/AbstractUnary.php
ArrayExpression::__construct in vendor/twig/twig/src/Node/Expression/ArrayExpression.php
ArrowFunctionExpression::__construct in vendor/twig/twig/src/Node/Expression/ArrowFunctionExpression.php
AssignTemplateVariable::__construct in vendor/twig/twig/src/Node/Expression/Variable/AssignTemplateVariable.php

... See full list

File

vendor/twig/twig/src/Node/Node.php, line 48

Class

Node
Represents a node in the AST.

Namespace

Twig\Node

Code

public function __construct(array $nodes = [], array $attributes = [], int $lineno = 0) {
    if (self::class === static::class) {
        trigger_deprecation('twig/twig', '3.15', \sprintf('Instantiating "%s" directly is deprecated; the class will become abstract in 4.0.', self::class));
    }
    foreach ($nodes as $name => $node) {
        if (!$node instanceof self) {
            throw new \InvalidArgumentException(\sprintf('Using "%s" for the value of node "%s" of "%s" is not supported. You must pass a \\Twig\\Node\\Node instance.', get_debug_type($node), $name, static::class));
        }
    }
    $this->nodes = $nodes;
    $this->attributes = $attributes;
    $this->lineno = $lineno;
    if (\func_num_args() > 3) {
        trigger_deprecation('twig/twig', '3.12', \sprintf('The "tag" constructor argument of the "%s" class is deprecated and ignored (check which TokenParser class set it to "%s"), the tag is now automatically set by the Parser when needed.', static::class, func_get_arg(3) ?: 'null'));
    }
}

API Navigation

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