Documentation

OptimizerNodeVisitor extends AbstractNodeVisitor
in package

Tries to optimize the AST.

This visitor is always the last registered one.

You can configure which optimizations you want to activate via the optimizer mode.

Tags
author

Fabien Potencier fabien@symfony.com

Table of Contents

OPTIMIZE_ALL  = -1
OPTIMIZE_FOR  = 2
OPTIMIZE_NONE  = 0
OPTIMIZE_RAW_FILTER  = 4
OPTIMIZE_VAR_ACCESS  = 8
$loops  : mixed
$loopsTargets  : mixed
$optimizers  : 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.
addLoopToAll()  : mixed
addLoopToCurrent()  : mixed
enterOptimizeFor()  : mixed
Optimizes "for" tag by removing the "loop" variable creation whenever possible.
leaveOptimizeFor()  : mixed
Optimizes "for" tag by removing the "loop" variable creation whenever possible.
optimizePrintNode()  : Node
Optimizes print nodes.
optimizeRawFilter()  : Node
Removes "raw" filters.

Constants

Properties

Methods

__construct()

public __construct([int $optimizers = -1 ]) : mixed
Parameters
$optimizers : int = -1

The optimizer mode

Return values
mixed

Search results