$node->getNode('node'), 'attribute' => $node->getNode('attribute'), ]; if ($node->hasNode('arguments')) { $nodes['arguments'] = $node->getNode('arguments'); } $isDefinedTest = $node->isDefinedTestEnabled(); $attributes = [ 'type' => $node->getAttribute('type'), 'ignore_strict_check' => $node->getAttribute('ignore_strict_check'), 'optimizable' => $node->getAttribute('optimizable'), ]; $getAttrNode = new GetAttrNode($nodes, $attributes, $node->getTemplateLine()); if ($isDefinedTest) { $getAttrNode->enableDefinedTest(); } return $getAttrNode; } /** * @inheritDoc */ public function leaveNode(Node $node, Environment $env): ?Node { return $node; } /** * @inheritDoc */ public function getPriority() { return 0; } }