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

Breadcrumb

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

function GetAttrExpression::__construct

Parameters

ArrayExpression|NameExpression|null $arguments:

Overrides Node::__construct

File

vendor/twig/twig/src/Node/Expression/GetAttrExpression.php, line 25

Class

GetAttrExpression

Namespace

Twig\Node\Expression

Code

public function __construct(AbstractExpression $node, AbstractExpression $attribute, ?AbstractExpression $arguments, string $type, int $lineno) {
    $nodes = [
        'node' => $node,
        'attribute' => $attribute,
    ];
    if (null !== $arguments) {
        $nodes['arguments'] = $arguments;
    }
    if ($arguments && !$arguments instanceof ArrayExpression && !$arguments instanceof NameExpression) {
        trigger_deprecation('twig/twig', '3.15', \sprintf('Not passing a "%s" instance as the "arguments" argument of the "%s" constructor is deprecated ("%s" given).', ArrayExpression::class, static::class, $arguments::class));
    }
    parent::__construct($nodes, [
        'type' => $type,
        'is_defined_test' => false,
        'ignore_strict_check' => false,
        'optimizable' => true,
    ], $lineno);
}
RSS feed
Powered by Drupal