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\NodeVisitorCode
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,
];
}