Function.php 953 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) 2009 Fabien Potencier
  6. * (c) 2010 Arnaud Le Blanc
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. @trigger_error('The Twig_Function_Function class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFunction instead.', E_USER_DEPRECATED);
  12. /**
  13. * Represents a function template function.
  14. *
  15. * Use Twig_SimpleFunction instead.
  16. *
  17. * @author Arnaud Le Blanc <arnaud.lb@gmail.com>
  18. *
  19. * @deprecated since 1.12 (to be removed in 2.0)
  20. */
  21. class Twig_Function_Function extends Twig_Function
  22. {
  23. protected $function;
  24. public function __construct($function, array $options = array())
  25. {
  26. $options['callable'] = $function;
  27. parent::__construct($options);
  28. $this->function = $function;
  29. }
  30. public function compile()
  31. {
  32. return $this->function;
  33. }
  34. }