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

Breadcrumb

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

function AssignNameExpression::__construct

Overrides NameExpression::__construct

File

vendor/twig/twig/src/Node/Expression/AssignNameExpression.php, line 21

Class

AssignNameExpression

Namespace

Twig\Node\Expression

Code

public function __construct(string $name, int $lineno) {
    if (self::class === static::class) {
        trigger_deprecation('twig/twig', '3.15', 'The "%s" class is deprecated, use "%s" instead.', self::class, AssignContextVariable::class);
    }
    // All names supported by ExpressionParser::parsePrimaryExpression() should be excluded
    if (\in_array(strtolower($name), [
        'true',
        'false',
        'none',
        'null',
    ])) {
        throw new SyntaxError(\sprintf('You cannot assign a value to "%s".', $name), $lineno);
    }
    parent::__construct($name, $lineno);
}

API Navigation

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