function AssignNameExpression::__construct
Overrides NameExpression::__construct
File
-
vendor/
twig/ twig/ src/ Node/ Expression/ AssignNameExpression.php, line 21
Class
Namespace
Twig\Node\ExpressionCode
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);
}