leftypol/inc/lib/Twig/ExtensionInterface.php

91 lines
2.3 KiB
PHP
Raw Normal View History

2011-10-05 04:22:53 +00:00
<?php
/*
* This file is part of Twig.
*
* (c) Fabien Potencier
2011-10-05 04:22:53 +00:00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Interface implemented by extension classes.
*
2013-08-01 19:20:12 +00:00
* @author Fabien Potencier <fabien@symfony.com>
2011-10-05 04:22:53 +00:00
*/
interface Twig_ExtensionInterface
{
/**
* Initializes the runtime environment.
*
* This is where you can load some file that contains filter functions for instance.
*
* @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_InitRuntimeInterface instead
2011-10-05 04:22:53 +00:00
*/
2013-08-01 19:20:12 +00:00
public function initRuntime(Twig_Environment $environment);
2011-10-05 04:22:53 +00:00
/**
* Returns the token parser instances to add to the existing list.
*
* @return Twig_TokenParserInterface[]
2011-10-05 04:22:53 +00:00
*/
2013-08-01 19:20:12 +00:00
public function getTokenParsers();
2011-10-05 04:22:53 +00:00
/**
* Returns the node visitor instances to add to the existing list.
*
* @return Twig_NodeVisitorInterface[]
2011-10-05 04:22:53 +00:00
*/
2013-08-01 19:20:12 +00:00
public function getNodeVisitors();
2011-10-05 04:22:53 +00:00
/**
* Returns a list of filters to add to the existing list.
*
* @return Twig_SimpleFilter[]
2011-10-05 04:22:53 +00:00
*/
2013-08-01 19:20:12 +00:00
public function getFilters();
2011-10-05 04:22:53 +00:00
/**
* Returns a list of tests to add to the existing list.
*
* @return Twig_SimpleTest[]
2011-10-05 04:22:53 +00:00
*/
2013-08-01 19:20:12 +00:00
public function getTests();
2011-10-05 04:22:53 +00:00
/**
* Returns a list of functions to add to the existing list.
*
* @return Twig_SimpleFunction[]
2011-10-05 04:22:53 +00:00
*/
2013-08-01 19:20:12 +00:00
public function getFunctions();
2011-10-05 04:22:53 +00:00
/**
* Returns a list of operators to add to the existing list.
*
* @return array<array> First array of unary operators, second array of binary operators
2011-10-05 04:22:53 +00:00
*/
2013-08-01 19:20:12 +00:00
public function getOperators();
2011-10-05 04:22:53 +00:00
/**
2013-08-01 19:20:12 +00:00
* Returns a list of global variables to add to the existing list.
2011-10-05 04:22:53 +00:00
*
2013-08-01 19:20:12 +00:00
* @return array An array of global variables
*
* @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_GlobalsInterface instead
2011-10-05 04:22:53 +00:00
*/
2013-08-01 19:20:12 +00:00
public function getGlobals();
2011-10-05 04:22:53 +00:00
/**
* Returns the name of the extension.
*
* @return string The extension name
*
* @deprecated since 1.26 (to be removed in 2.0), not used anymore internally
2011-10-05 04:22:53 +00:00
*/
2013-08-01 19:20:12 +00:00
public function getName();
2011-10-05 04:22:53 +00:00
}
class_alias('Twig_ExtensionInterface', 'Twig\Extension\ExtensionInterface', false);
class_exists('Twig_Environment');