EscaperNodeVisitor
extends AbstractNodeVisitor
in package
Used to make node visitors compatible with Twig 1.x and 2.x.
Tags
Table of Contents
- $blocks : mixed
- $defaultStrategy : mixed
- $safeAnalysis : mixed
- $safeVars : mixed
- $statusStack : mixed
- $traverser : mixed
- __construct() : mixed
- enterNode() : Node
- Called before child nodes are visited.
- getPriority() : mixed
- leaveNode() : Node|null
- Called after child nodes are visited.
- doEnterNode() : Node
- Called before child nodes are visited.
- doLeaveNode() : Node|null
- Called after child nodes are visited.
- escapeInlinePrintNode() : mixed
- escapePrintNode() : mixed
- getEscaperFilter() : FilterExpression
- isSafeFor() : mixed
- needEscaping() : mixed
- preEscapeFilterNode() : mixed
- shouldUnwrapConditional() : mixed
- unwrapConditional() : mixed
Properties
$blocks
private
mixed
$blocks
= []
$defaultStrategy
private
mixed
$defaultStrategy
= false
$safeAnalysis
private
mixed
$safeAnalysis
$safeVars
private
mixed
$safeVars
= []
$statusStack
private
mixed
$statusStack
= []
$traverser
private
mixed
$traverser
Methods
__construct()
public
__construct() : mixed
Return values
mixed —enterNode()
Called before child nodes are visited.
public
final enterNode(Node $node, Environment $env) : Node
Parameters
- $node : Node
- $env : Environment
Return values
Node —The modified node
getPriority()
public
getPriority() : mixed
Return values
mixed —leaveNode()
Called after child nodes are visited.
public
final leaveNode(Node $node, Environment $env) : Node|null
Parameters
- $node : Node
- $env : Environment
Return values
Node|null —The modified node or null if the node must be removed
doEnterNode()
Called before child nodes are visited.
protected
doEnterNode(Node $node, Environment $env) : Node
Parameters
- $node : Node
- $env : Environment
Return values
Node —The modified node
doLeaveNode()
Called after child nodes are visited.
protected
doLeaveNode(Node $node, Environment $env) : Node|null
Parameters
- $node : Node
- $env : Environment
Return values
Node|null —The modified node or null if the node must be removed
escapeInlinePrintNode()
private
escapeInlinePrintNode(InlinePrint $node, Environment $env, mixed $type) : mixed
Parameters
- $node : InlinePrint
- $env : Environment
- $type : mixed
Return values
mixed —escapePrintNode()
private
escapePrintNode(PrintNode $node, Environment $env, mixed $type) : mixed
Parameters
- $node : PrintNode
- $env : Environment
- $type : mixed
Return values
mixed —getEscaperFilter()
private
getEscaperFilter(string $type, Node $node) : FilterExpression
Parameters
- $type : string
- $node : Node
Return values
FilterExpression —isSafeFor()
private
isSafeFor(mixed $type, Node $expression, mixed $env) : mixed
Parameters
- $type : mixed
- $expression : Node
- $env : mixed
Return values
mixed —needEscaping()
private
needEscaping(Environment $env) : mixed
Parameters
- $env : Environment
Return values
mixed —preEscapeFilterNode()
private
preEscapeFilterNode(FilterExpression $filter, Environment $env) : mixed
Parameters
- $filter : FilterExpression
- $env : Environment
Return values
mixed —shouldUnwrapConditional()
private
shouldUnwrapConditional(ConditionalExpression $expression, Environment $env, mixed $type) : mixed
Parameters
- $expression : ConditionalExpression
- $env : Environment
- $type : mixed
Return values
mixed —unwrapConditional()
private
unwrapConditional(ConditionalExpression $expression, Environment $env, mixed $type) : mixed
Parameters
- $expression : ConditionalExpression
- $env : Environment
- $type : mixed