protected function Twig_NodeVisitor_SafeAnalysis::setSafe in Translation template extractor 7.3
Same name and namespace in other branches
- 6.3 vendor/Twig/NodeVisitor/SafeAnalysis.php \Twig_NodeVisitor_SafeAnalysis::setSafe()
1 call to Twig_NodeVisitor_SafeAnalysis::setSafe()
- Twig_NodeVisitor_SafeAnalysis::doLeaveNode in vendor/
Twig/ NodeVisitor/ SafeAnalysis.php - Called after child nodes are visited.
File
- vendor/
Twig/ NodeVisitor/ SafeAnalysis.php, line 42
Class
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,
);
}