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

Breadcrumb

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

function Node::setAttribute

Same name in this branch
  1. 11.1.x vendor/phpstan/phpdoc-parser/src/Ast/Node.php \PHPStan\PhpDocParser\Ast\Node::setAttribute()
  2. 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

... See full list

File

vendor/twig/twig/src/Node/Node.php, line 164

Class

Node
Represents a node in the AST.

Namespace

Twig\Node

Code

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;
}

API Navigation

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