AbstractOptimizer
abstract class AbstractOptimizer
Properties
protected int | $cnt | ||
protected int | $i | ||
protected bool | $changed | ||
protected array | $tokens |
Methods
string
optimize(string $php)
Optimize the control structures of a script
void
optimizeTokens()
Optimize the stored tokens
void
reset(string $php)
Reset the internal state of this optimizer
string
serialize()
Serialize the tokens back to source
void
skipToString(string $str)
Move the internal cursor until it reaches given string
void
skipWhitespace()
Skip all whitespace
void
unindentBlock(int $start, int $end)
Remove one tab of indentation off a range of PHP tokens
Details
at line 41
string
optimize(string $php)
Optimize the control structures of a script
Removes brackets in control structures wherever possible. Prevents the generation of EXT_STMT opcodes where they're not strictly required.
at line 63
abstract protected void
optimizeTokens()
Optimize the stored tokens
at line 71
protected void
reset(string $php)
Reset the internal state of this optimizer
at line 84
protected string
serialize()
Serialize the tokens back to source
at line 104
protected void
skipToString(string $str)
Move the internal cursor until it reaches given string
at line 114
protected void
skipWhitespace()
Skip all whitespace
at line 126
protected void
unindentBlock(int $start, int $end)
Remove one tab of indentation off a range of PHP tokens