You are here

public function Twig_NodeVisitor_SafeAnalysis::getSafe in Translation template extractor 6.3

Same name and namespace in other branches
  1. 7.3 vendor/Twig/NodeVisitor/SafeAnalysis.php \Twig_NodeVisitor_SafeAnalysis::getSafe()
1 call to Twig_NodeVisitor_SafeAnalysis::getSafe()
Twig_NodeVisitor_SafeAnalysis::leaveNode in vendor/Twig/NodeVisitor/SafeAnalysis.php
Called after child nodes are visited.

File

vendor/Twig/NodeVisitor/SafeAnalysis.php, line 13

Class

Twig_NodeVisitor_SafeAnalysis

Code

public function getSafe(Twig_NodeInterface $node) {
  $hash = spl_object_hash($node);
  if (!isset($this->data[$hash])) {
    return;
  }
  foreach ($this->data[$hash] as $bucket) {
    if ($bucket['key'] !== $node) {
      continue;
    }
    if (in_array('html_attr', $bucket['value'])) {
      $bucket['value'][] = 'html';
    }
    return $bucket['value'];
  }
}