function Node::setAttribute
Same name in this branch
- 11.1.x vendor/phpstan/phpdoc-parser/src/Ast/Node.php \PHPStan\PhpDocParser\Ast\Node::setAttribute()
- 11.1.x vendor/nikic/php-parser/lib/PhpParser/Node.php \PhpParser\Node::setAttribute()
12 calls to Node::setAttribute()
- AbstractExpression::setExplicitParentheses in vendor/
twig/ twig/ src/ Node/ Expression/ AbstractExpression.php - CallExpression::getTwigCallable in vendor/
twig/ twig/ src/ Node/ Expression/ CallExpression.php - Overrides the Twig callable based on attributes (as potentially, attributes changed between the creation and the compilation of the node).
- EmbedNode::__construct in vendor/
twig/ twig/ src/ Node/ EmbedNode.php - FilterExpression::compile in vendor/
twig/ twig/ src/ Node/ Expression/ FilterExpression.php - FilterExpression::__construct in vendor/
twig/ twig/ src/ Node/ Expression/ FilterExpression.php
File
-
vendor/
twig/ twig/ src/ Node/ Node.php, line 164
Class
- Node
- Represents a node in the AST.
Namespace
Twig\NodeCode
public function setAttribute(string $name, $value) : void {
$triggerDeprecation = \func_num_args() > 2 ? func_get_arg(2) : true;
if ($triggerDeprecation && isset($this->attributeNameDeprecations[$name])) {
$dep = $this->attributeNameDeprecations[$name];
if ($dep->getNewName()) {
trigger_deprecation($dep->getPackage(), $dep->getVersion(), 'Setting attribute "%s" on a "%s" class is deprecated, set the "%s" attribute instead.', $name, static::class, $dep->getNewName());
}
else {
trigger_deprecation($dep->getPackage(), $dep->getVersion(), 'Setting attribute "%s" on a "%s" class is deprecated.', $name, static::class);
}
}
$this->attributes[$name] = $value;
}