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

Breadcrumb

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

function SafeAnalysisNodeVisitor::setSafe

1 call to SafeAnalysisNodeVisitor::setSafe()
SafeAnalysisNodeVisitor::leaveNode in vendor/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php
Called after child nodes are visited.

File

vendor/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php, line 65

Class

SafeAnalysisNodeVisitor
@internal

Namespace

Twig\NodeVisitor

Code

private function setSafe(Node $node, array $safe) : void {
    $hash = spl_object_hash($node);
    if (isset($this->data[$hash])) {
        foreach ($this->data[$hash] as &$bucket) {
            if ($bucket['key'] === $node) {
                $bucket['value'] = $safe;
                return;
            }
        }
    }
    $this->data[$hash][] = [
        'key' => $node,
        'value' => $safe,
    ];
}
RSS feed
Powered by Drupal