You are here

public function Twig_NodeVisitor_Optimizer::__construct in Translation template extractor 6.3

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

Constructor.

Parameters

int $optimizers The optimizer mode:

File

vendor/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;
}