Lines Matching refs:env

47     protected function doEnterNode(Node $node, Environment $env)  argument
50 …if ($env->hasExtension(EscaperExtension::class) && $defaultStrategy = $env->getExtension(EscaperEx…
58 …e->getAttribute('name')]) ? $this->blocks[$node->getAttribute('name')] : $this->needEscaping($env);
66 protected function doLeaveNode(Node $node, Environment $env) argument
73 return $this->preEscapeFilterNode($node, $env);
74 } elseif ($node instanceof PrintNode && false !== $type = $this->needEscaping($env)) {
76 …ion instanceof ConditionalExpression && $this->shouldUnwrapConditional($expression, $env, $type)) {
77 …return new DoNode($this->unwrapConditional($expression, $env, $type), $expression->getTemplateLine…
80 return $this->escapePrintNode($node, $env, $type);
86 $this->blocks[$node->getAttribute('name')] = $this->needEscaping($env);
92 …private function shouldUnwrapConditional(ConditionalExpression $expression, Environment $env, $typ… argument
94 $expr2Safe = $this->isSafeFor($type, $expression->getNode('expr2'), $env);
95 $expr3Safe = $this->isSafeFor($type, $expression->getNode('expr3'), $env);
100 private function unwrapConditional(ConditionalExpression $expression, Environment $env, $type) argument
104 …if ($expr2 instanceof ConditionalExpression && $this->shouldUnwrapConditional($expr2, $env, $type)…
105 $expr2 = $this->unwrapConditional($expr2, $env, $type);
107 …r2 = $this->escapeInlinePrintNode(new InlinePrint($expr2, $expr2->getTemplateLine()), $env, $type);
110 …if ($expr3 instanceof ConditionalExpression && $this->shouldUnwrapConditional($expr3, $env, $type)…
111 $expr3 = $this->unwrapConditional($expr3, $env, $type);
113 …r3 = $this->escapeInlinePrintNode(new InlinePrint($expr3, $expr3->getTemplateLine()), $env, $type);
119 private function escapeInlinePrintNode(InlinePrint $node, Environment $env, $type) argument
123 if ($this->isSafeFor($type, $expression, $env)) {
130 private function escapePrintNode(PrintNode $node, Environment $env, $type) argument
138 if ($this->isSafeFor($type, $expression, $env)) {
147 private function preEscapeFilterNode(FilterExpression $filter, Environment $env) argument
151 $type = $env->getFilter($name)->getPreEscape();
157 if ($this->isSafeFor($type, $node, $env)) {
166 private function isSafeFor($type, Node $expression, $env) argument
172 $this->traverser = new NodeTraverser($env, [$this->safeAnalysis]);
184 private function needEscaping(Environment $env) argument