function TwigNodeVisitorCheckDeprecations::leaveNode
Same name in other branches
- 11.x core/lib/Drupal/Core/Template/TwigNodeVisitorCheckDeprecations.php \Drupal\Core\Template\TwigNodeVisitorCheckDeprecations::leaveNode()
File
-
core/
lib/ Drupal/ Core/ Template/ TwigNodeVisitorCheckDeprecations.php, line 58
Class
- TwigNodeVisitorCheckDeprecations
- Provides a Node Visitor to trigger errors if deprecated variables are used.
Namespace
Drupal\Core\TemplateCode
public function leaveNode(Node $node, Environment $env) : ?Node {
// At the end of the template, check the used variables are not deprecated.
if ($node instanceof ModuleNode) {
if (!empty($this->usedNames)) {
$checkNode = new Node([
new TwigNodeCheckDeprecations($this->usedNames),
$node->getNode('display_end'),
]);
$node->setNode('display_end', $checkNode);
}
}
return $node;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.