From 8069e235fd2971675ee5fc05026ffa9bce5cbbb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 2 Aug 2013 22:43:56 +0200 Subject: move Twig in 3rdparty --- inc/3rdparty/Twig/Function/Function.php | 38 +++++++++++++++++++++++++++++++ inc/3rdparty/Twig/Function/Method.php | 40 +++++++++++++++++++++++++++++++++ inc/3rdparty/Twig/Function/Node.php | 39 ++++++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 inc/3rdparty/Twig/Function/Function.php create mode 100644 inc/3rdparty/Twig/Function/Method.php create mode 100644 inc/3rdparty/Twig/Function/Node.php (limited to 'inc/3rdparty/Twig/Function') diff --git a/inc/3rdparty/Twig/Function/Function.php b/inc/3rdparty/Twig/Function/Function.php new file mode 100644 index 00000000..d1e1b96a --- /dev/null +++ b/inc/3rdparty/Twig/Function/Function.php @@ -0,0 +1,38 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Function_Function extends Twig_Function +{ + protected $function; + + public function __construct($function, array $options = array()) + { + $options['callable'] = $function; + + parent::__construct($options); + + $this->function = $function; + } + + public function compile() + { + return $this->function; + } +} diff --git a/inc/3rdparty/Twig/Function/Method.php b/inc/3rdparty/Twig/Function/Method.php new file mode 100644 index 00000000..67039a95 --- /dev/null +++ b/inc/3rdparty/Twig/Function/Method.php @@ -0,0 +1,40 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Function_Method extends Twig_Function +{ + 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; + $this->method = $method; + } + + public function compile() + { + return sprintf('$this->env->getExtension(\'%s\')->%s', $this->extension->getName(), $this->method); + } +} diff --git a/inc/3rdparty/Twig/Function/Node.php b/inc/3rdparty/Twig/Function/Node.php new file mode 100644 index 00000000..06a0d0db --- /dev/null +++ b/inc/3rdparty/Twig/Function/Node.php @@ -0,0 +1,39 @@ + + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Function_Node extends Twig_Function +{ + 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.2.3