From 0fe552857468aa12097a74e08f51f5aaa983be07 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Thu, 1 Aug 2013 15:20:12 -0400 Subject: Upgrade Twig library --- inc/lib/Twig/Function.php | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'inc/lib/Twig/Function.php') diff --git a/inc/lib/Twig/Function.php b/inc/lib/Twig/Function.php index 1197924a..b5ffb2b0 100644 --- a/inc/lib/Twig/Function.php +++ b/inc/lib/Twig/Function.php @@ -12,21 +12,35 @@ /** * Represents a template function. * - * @package twig - * @author Fabien Potencier + * Use Twig_SimpleFunction instead. + * + * @author Fabien Potencier + * @deprecated since 1.12 (to be removed in 2.0) */ -abstract class Twig_Function implements Twig_FunctionInterface +abstract class Twig_Function implements Twig_FunctionInterface, Twig_FunctionCallableInterface { protected $options; + protected $arguments = array(); public function __construct(array $options = array()) { $this->options = array_merge(array( 'needs_environment' => false, 'needs_context' => false, + 'callable' => null, ), $options); } + public function setArguments($arguments) + { + $this->arguments = $arguments; + } + + public function getArguments() + { + return $this->arguments; + } + public function needsEnvironment() { return $this->options['needs_environment']; @@ -49,4 +63,9 @@ abstract class Twig_Function implements Twig_FunctionInterface return array(); } + + public function getCallable() + { + return $this->options['callable']; + } } -- cgit v1.3