You are here

public function Twig_NodeVisitor_Optimizer::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php \Twig_NodeVisitor_Optimizer::__construct()

Constructor.

Parameters

int $optimizers The optimizer mode:

File

vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php, line 41

Class

Twig_NodeVisitor_Optimizer
Twig_NodeVisitor_Optimizer tries to optimizes the AST.

Code

public function __construct($optimizers = -1) {
  if (!is_int($optimizers) || $optimizers > (self::OPTIMIZE_FOR | self::OPTIMIZE_RAW_FILTER | self::OPTIMIZE_VAR_ACCESS)) {
    throw new InvalidArgumentException(sprintf('Optimizer mode "%s" is not valid.', $optimizers));
  }
  $this->optimizers = $optimizers;
}