Lines Matching refs:type

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);
92 …rivate function shouldUnwrapConditional(ConditionalExpression $expression, Environment $env, $type) 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 … ($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 … ($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)) {
127 … return new InlinePrint($this->getEscaperFilter($type, $expression), $node->getTemplateLine());
130 private function escapePrintNode(PrintNode $node, Environment $env, $type) argument
132 if (false === $type) {
138 if ($this->isSafeFor($type, $expression, $env)) {
144 return new $class($this->getEscaperFilter($type, $expression), $node->getTemplateLine());
151 $type = $env->getFilter($name)->getPreEscape();
152 if (null === $type) {
157 if ($this->isSafeFor($type, $node, $env)) {
161 $filter->setNode('node', $this->getEscaperFilter($type, $node));
166 private function isSafeFor($type, Node $expression, $env) argument
181 return \in_array($type, $safe) || \in_array('all', $safe);
193 private function getEscaperFilter(string $type, Node $node): FilterExpression argument
197 …$args = new Node([new ConstantExpression((string) $type, $line), new ConstantExpression(null, $lin…