Optimizer.php 664B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) 2010 Fabien Potencier
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. class Twig_Extension_Optimizer extends Twig_Extension
  11. {
  12. protected $optimizers;
  13. public function __construct($optimizers = -1)
  14. {
  15. $this->optimizers = $optimizers;
  16. }
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public function getNodeVisitors()
  21. {
  22. return array(new Twig_NodeVisitor_Optimizer($this->optimizers));
  23. }
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function getName()
  28. {
  29. return 'optimizer';
  30. }
  31. }