protected function Twig_NodeVisitor_SafeAnalysis::setSafe

1 call to Twig_NodeVisitor_SafeAnalysis::setSafe()
Twig_NodeVisitor_SafeAnalysis::leaveNode in drupal/core/vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php
Called after child nodes are visited.

File

drupal/core/vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php, line 27

Class

Twig_NodeVisitor_SafeAnalysis

Code

protected function setSafe(Twig_NodeInterface $node, array $safe) {
  $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][] = array(
    'key' => $node,
    'value' => $safe,
  );
}