function TwigNodeVisitorCheckDeprecations::leaveNode

Same name and namespace in other branches
  1. 10 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\Template

Code

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.