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/Filter/Function.php | 8 ++++++-- inc/lib/Twig/Filter/Method.php | 11 ++++++++--- inc/lib/Twig/Filter/Node.php | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 inc/lib/Twig/Filter/Node.php (limited to 'inc/lib/Twig/Filter') diff --git a/inc/lib/Twig/Filter/Function.php b/inc/lib/Twig/Filter/Function.php index 1de078b2..ad374a55 100644 --- a/inc/lib/Twig/Filter/Function.php +++ b/inc/lib/Twig/Filter/Function.php @@ -12,8 +12,10 @@ /** * Represents a function template filter. * - * @package twig - * @author Fabien Potencier + * Use Twig_SimpleFilter instead. + * + * @author Fabien Potencier + * @deprecated since 1.12 (to be removed in 2.0) */ class Twig_Filter_Function extends Twig_Filter { @@ -21,6 +23,8 @@ class Twig_Filter_Function extends Twig_Filter public function __construct($function, array $options = array()) { + $options['callable'] = $function; + parent::__construct($options); $this->function = $function; diff --git a/inc/lib/Twig/Filter/Method.php b/inc/lib/Twig/Filter/Method.php index d831e0f2..63c8c3be 100644 --- a/inc/lib/Twig/Filter/Method.php +++ b/inc/lib/Twig/Filter/Method.php @@ -12,15 +12,20 @@ /** * Represents a method template filter. * - * @package twig - * @author Fabien Potencier + * Use Twig_SimpleFilter instead. + * + * @author Fabien Potencier + * @deprecated since 1.12 (to be removed in 2.0) */ class Twig_Filter_Method extends Twig_Filter { - protected $extension, $method; + protected $extension; + protected $method; public function __construct(Twig_ExtensionInterface $extension, $method, array $options = array()) { + $options['callable'] = array($extension, $method); + parent::__construct($options); $this->extension = $extension; diff --git a/inc/lib/Twig/Filter/Node.php b/inc/lib/Twig/Filter/Node.php new file mode 100644 index 00000000..8744c5e0 --- /dev/null +++ b/inc/lib/Twig/Filter/Node.php @@ -0,0 +1,39 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Filter_Node extends Twig_Filter +{ + protected $class; + + public function __construct($class, array $options = array()) + { + parent::__construct($options); + + $this->class = $class; + } + + public function getClass() + { + return $this->class; + } + + public function compile() + { + } +} -- cgit v1.3