Function.php 866 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. @trigger_error('The Twig_Test_Function class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleTest instead.', E_USER_DEPRECATED);
  11. /**
  12. * Represents a function template test.
  13. *
  14. * @author Fabien Potencier <fabien@symfony.com>
  15. *
  16. * @deprecated since 1.12 (to be removed in 2.0)
  17. */
  18. class Twig_Test_Function extends Twig_Test
  19. {
  20. protected $function;
  21. public function __construct($function, array $options = array())
  22. {
  23. $options['callable'] = $function;
  24. parent::__construct($options);
  25. $this->function = $function;
  26. }
  27. public function compile()
  28. {
  29. return $this->function;
  30. }
  31. }