27 $hash = spl_object_hash($node);
28 if (!isset($this->
data[$hash])) {
32 foreach ($this->
data[$hash] as $bucket) {
33 if ($bucket[
'key'] !== $node) {
37 if (in_array(
'html_attr', $bucket[
'value'])) {
38 $bucket[
'value'][] =
'html';
41 return $bucket[
'value'];
47 $hash = spl_object_hash($node);
48 if (isset($this->
data[$hash])) {
49 foreach ($this->
data[$hash] as &$bucket) {
50 if ($bucket[
'key'] === $node) {
51 $bucket[
'value'] = $safe;
86 $args = $node->
getNode(
'arguments');
88 $safe = $filter->getSafe($args);
99 $args = $node->
getNode(
'arguments');
115 if (
'_self' ==
$name || in_array(
$name, $this->safeVars)) {
129 if (null === $a || null === $b) {
133 if (in_array(
'all', $a)) {
137 if (in_array(
'all', $b)) {
141 return array_intersect($a, $b);
150 class_alias(
'Twig_NodeVisitor_SafeAnalysis',
'Twig\NodeVisitor\SafeAnalysisNodeVisitor',
false);
Represents a node in the AST.
getPriority()
Returns the priority for this visitor.
Represents a node in the AST.
getFilter($name)
Get a filter by name.
getFunction($name)
Get a function by name.
Represents a parent node.
Twig_BaseNodeVisitor can be used to make node visitors compatible with Twig 1.x and 2...
doLeaveNode(Twig_Node $node, Twig_Environment $env)
Create styles array
The data for the language used.
doEnterNode(Twig_Node $node, Twig_Environment $env)
Represents a block call node.
Stores the Twig configuration.
getSafe(Twig_NodeInterface $node)
setSafe(Twig_NodeInterface $node, array $safe)
intersectSafe(array $a=null, array $b=null)