# Class yii\twig\GetAttrAdjuster

Inheritance | yii\twig\GetAttrAdjuster
Implements | Twig\NodeVisitor\NodeVisitorInterface
Source Code | https://github.com/yiisoft/yii2-twig/blob/master/GetAttrAdjuster.php

GetAttrAdjuster swaps Twig_Node_Expression_GetAttr nodes with yii\twig\GetAttr nodes.

## Public Methods

Hide inherited methods

Method | Description | Defined By
--- | --- | ---
enterNode() |  | yii\twig\GetAttrAdjuster
getPriority() |  | yii\twig\GetAttrAdjuster
leaveNode() |  | yii\twig\GetAttrAdjuster

## Method Details

Hide inherited methods

enterNode() public method

public void enterNode ( \Twig\Node\Node $node, \Twig\Environment $env )
$node |  |
$env |  |

Source code

                    public function enterNode(Node $node, Environment $env): Node
    {
        // Is it a Twig_Node_Expression_GetAttr (and not a subclass)?
        if (get_class($node) === GetAttrExpression::class) {
            // "Clone" it into a GetAttr node
            $nodes = [
                'node' => $node->getNode('node'),
                'attribute' => $node->getNode('attribute')
            ];
            if ($node->hasNode('arguments')) {
                $nodes['arguments'] = $node->getNode('arguments');
            }
            $attributes = [
                'type' => $node->getAttribute('type'),
                'is_defined_test' => $node->getAttribute('is_defined_test'),
                'ignore_strict_check' => $node->getAttribute('ignore_strict_check')
            ];
            $node = new GetAttr($nodes, $attributes, $node->getTemplateLine(), $node->getNodeTag());
        }
        return $node;
    }

getPriority() public method

public void getPriority ( )

Source code

                    public function getPriority()
    {
        return 0;
    }

leaveNode() public method

public void leaveNode ( \Twig\Node\Node $node, \Twig\Environment $env )
$node |  |
$env |  |

Source code

                    public function leaveNode(Node $node, Environment $env): ?Node
    {
        return $node;
    }