1<?php 2 3/* 4 * This file is part of Twig. 5 * 6 * (c) Fabien Potencier 7 * 8 * For the full copyright and license information, please view the LICENSE 9 * file that was distributed with this source code. 10 */ 11 12namespace Twig\Extension; 13 14use Twig\NodeVisitor\OptimizerNodeVisitor; 15 16/** 17 * @final 18 */ 19class OptimizerExtension extends AbstractExtension 20{ 21 protected $optimizers; 22 23 public function __construct($optimizers = -1) 24 { 25 $this->optimizers = $optimizers; 26 } 27 28 public function getNodeVisitors() 29 { 30 return [new OptimizerNodeVisitor($this->optimizers)]; 31 } 32 33 public function getName() 34 { 35 return 'optimizer'; 36 } 37} 38 39class_alias('Twig\Extension\OptimizerExtension', 'Twig_Extension_Optimizer'); 40