summaryrefslogtreecommitdiff
path: root/inc/lib/Twig/Function.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/lib/Twig/Function.php')
-rw-r--r--inc/lib/Twig/Function.php25
1 files changed, 22 insertions, 3 deletions
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 <fabien@symfony.com>
+ * Use Twig_SimpleFunction instead.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @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'];
+ }
}