diff options
author | Jesús <heckyel@hyperbola.info> | 2019-08-18 21:14:58 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2019-08-18 21:14:58 -0500 |
commit | 2eed7b082f83630301e51f57ca8394de228a8605 (patch) | |
tree | 1d19962d22d30f99317d9276e4bae7744fc93fc2 /public/system/library/template/Twig/Function | |
download | librecart-2eed7b082f83630301e51f57ca8394de228a8605.tar.lz librecart-2eed7b082f83630301e51f57ca8394de228a8605.tar.xz librecart-2eed7b082f83630301e51f57ca8394de228a8605.zip |
first commit
Diffstat (limited to 'public/system/library/template/Twig/Function')
3 files changed, 126 insertions, 0 deletions
diff --git a/public/system/library/template/Twig/Function/Function.php b/public/system/library/template/Twig/Function/Function.php new file mode 100644 index 0000000..ae83e15 --- /dev/null +++ b/public/system/library/template/Twig/Function/Function.php @@ -0,0 +1,41 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2009 Fabien Potencier + * (c) 2010 Arnaud Le Blanc + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +@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); + +/** + * Represents a function template function. + * + * Use Twig_SimpleFunction instead. + * + * @author Arnaud Le Blanc <arnaud.lb@gmail.com> + * + * @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/public/system/library/template/Twig/Function/Method.php b/public/system/library/template/Twig/Function/Method.php new file mode 100644 index 0000000..ba9945e --- /dev/null +++ b/public/system/library/template/Twig/Function/Method.php @@ -0,0 +1,43 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2009 Fabien Potencier + * (c) 2010 Arnaud Le Blanc + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +@trigger_error('The Twig_Function_Method class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFunction instead.', E_USER_DEPRECATED); + +/** + * Represents a method template function. + * + * Use Twig_SimpleFunction instead. + * + * @author Arnaud Le Blanc <arnaud.lb@gmail.com> + * + * @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/public/system/library/template/Twig/Function/Node.php b/public/system/library/template/Twig/Function/Node.php new file mode 100644 index 0000000..118b0ba --- /dev/null +++ b/public/system/library/template/Twig/Function/Node.php @@ -0,0 +1,42 @@ +<?php + +/* + * This file is part of Twig. + * + * (c) 2011 Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +@trigger_error('The Twig_Function_Node class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFunction instead.', E_USER_DEPRECATED); + +/** + * Represents a template function as a node. + * + * Use Twig_SimpleFunction instead. + * + * @author Fabien Potencier <fabien@symfony.com> + * + * @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() + { + } +} |