public function Twig_NodeVisitor_SafeAnalysis::getSafe in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php \Twig_NodeVisitor_SafeAnalysis::getSafe()
1 call to Twig_NodeVisitor_SafeAnalysis::getSafe()
- Twig_NodeVisitor_SafeAnalysis::doLeaveNode in vendor/
twig/ twig/ lib/ Twig/ NodeVisitor/ SafeAnalysis.php - Called after child nodes are visited.
File
- vendor/
twig/ twig/ lib/ Twig/ NodeVisitor/ SafeAnalysis.php, line 22
Class
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'];
}
}