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

Breadcrumb

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

function SandboxNodeVisitor::leaveNode

Overrides NodeVisitorInterface::leaveNode

File

vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php, line 106

Class

SandboxNodeVisitor
@author Fabien Potencier <fabien@symfony.com>

Namespace

Twig\NodeVisitor

Code

public function leaveNode(Node $node, Environment $env) : ?Node {
    if ($node instanceof ModuleNode) {
        $this->inAModule = false;
        $node->setNode('constructor_end', new Nodes([
            new CheckSecurityCallNode(),
            $node->getNode('constructor_end'),
        ]));
        $node->setNode('class_end', new Nodes([
            new CheckSecurityNode($this->filters, $this->tags, $this->functions),
            $node->getNode('class_end'),
        ]));
    }
    elseif ($this->inAModule) {
        if ($node instanceof PrintNode || $node instanceof SetNode) {
            $this->needsToStringWrap = false;
        }
    }
    return $node;
}
RSS feed
Powered by Drupal