class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface
TwigNodeVisitorOptimizer tries to optimizes the AST.
This visitor is always the last registered one.
You can configure which optimizations you want to activate via the optimizer mode.
Constants
| OPTIMIZE_ALL |
|
| OPTIMIZE_NONE |
|
| OPTIMIZE_FOR |
|
| OPTIMIZE_RAW_FILTER |
|
| OPTIMIZE_VAR_ACCESS |
|
Methods
|
__construct(integer $optimizers = -1)
Constructor. |
||
| Twig_NodeInterface |
enterNode(Twig_NodeInterface $node, Twig_Environment $env)
Called before child nodes are visited. |
|
| Twig_NodeInterface|false |
leaveNode(Twig_NodeInterface $node, Twig_Environment $env)
Called after child nodes are visited. |
|
| integer |
getPriority()
Returns the priority for this visitor. |
Details
at line 40
public
__construct(integer $optimizers = -1)
Constructor.
at line 52
public Twig_NodeInterface
enterNode(Twig_NodeInterface $node, Twig_Environment $env)
Called before child nodes are visited.
at line 78
public Twig_NodeInterface|false
leaveNode(Twig_NodeInterface $node, Twig_Environment $env)
Called after child nodes are visited.
at line 242
public integer
getPriority()
Returns the priority for this visitor.
Priority should be between -10 and 10 (0 is the default).