function Node::getAttribute
Same name in this branch
- 11.1.x vendor/phpstan/phpdoc-parser/src/Ast/Node.php \PHPStan\PhpDocParser\Ast\Node::getAttribute()
- 11.1.x vendor/nikic/php-parser/lib/PhpParser/Node.php \PhpParser\Node::getAttribute()
35 calls to Node::getAttribute()
- AbstractExpression::hasExplicitParentheses in vendor/
twig/ twig/ src/ Node/ Expression/ AbstractExpression.php - AbstractExpression::isGenerator in vendor/
twig/ twig/ src/ Node/ Expression/ AbstractExpression.php - AssignTemplateVariable::compile in vendor/
twig/ twig/ src/ Node/ Expression/ Variable/ AssignTemplateVariable.php - BlockReferenceExpression::compile in vendor/
twig/ twig/ src/ Node/ Expression/ BlockReferenceExpression.php - BlockReferenceNode::compile in vendor/
twig/ twig/ src/ Node/ BlockReferenceNode.php
File
-
vendor/
twig/ twig/ src/ Node/ Node.php, line 145
Class
- Node
- Represents a node in the AST.
Namespace
Twig\NodeCode
public function getAttribute(string $name) {
if (!\array_key_exists($name, $this->attributes)) {
throw new \LogicException(\sprintf('Attribute "%s" does not exist for Node "%s".', $name, static::class));
}
$triggerDeprecation = \func_num_args() > 1 ? func_get_arg(1) : true;
if ($triggerDeprecation && isset($this->attributeNameDeprecations[$name])) {
$dep = $this->attributeNameDeprecations[$name];
if ($dep->getNewName()) {
trigger_deprecation($dep->getPackage(), $dep->getVersion(), 'Getting attribute "%s" on a "%s" class is deprecated, get the "%s" attribute instead.', $name, static::class, $dep->getNewName());
}
else {
trigger_deprecation($dep->getPackage(), $dep->getVersion(), 'Getting attribute "%s" on a "%s" class is deprecated.', $name, static::class);
}
}
return $this->attributes[$name];
}