Twig_NodeVisitor_SafeAnalysis
extends SafeAnalysisNodeVisitor
in package
Used to make node visitors compatible with Twig 1.x and 2.x.
Tags
Table of Contents
- $data : mixed
- $safeVars : mixed
- enterNode() : Node
- Called before child nodes are visited.
- getPriority() : mixed
- getSafe() : mixed
- leaveNode() : Node|null
- Called after child nodes are visited.
- setSafeVars() : mixed
- doEnterNode() : Node
- Called before child nodes are visited.
- doLeaveNode() : Node|null
- Called after child nodes are visited.
- intersectSafe() : array<string|int, mixed>
- setSafe() : mixed
Properties
$data
private
mixed
$data
= []
$safeVars
private
mixed
$safeVars
= []
Methods
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 —getSafe()
public
getSafe(Node $node) : mixed
Parameters
- $node : Node
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
setSafeVars()
public
setSafeVars(mixed $safeVars) : mixed
Parameters
- $safeVars : mixed
Return values
mixed —doEnterNode()
Called before child nodes are visited.
protected
abstract 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
abstract 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
intersectSafe()
private
intersectSafe([array<string|int, mixed> $a = null ][, array<string|int, mixed> $b = null ]) : array<string|int, mixed>
Parameters
- $a : array<string|int, mixed> = null
- $b : array<string|int, mixed> = null
Return values
array<string|int, mixed> —setSafe()
private
setSafe(Node $node, array<string|int, mixed> $safe) : mixed
Parameters
- $node : Node
- $safe : array<string|int, mixed>