diff --git a/lib/Twig/CompilerInterface.php b/lib/Twig/CompilerInterface.php index 272c7672f..c9ba7c3b6 100644 --- a/lib/Twig/CompilerInterface.php +++ b/lib/Twig/CompilerInterface.php @@ -18,19 +18,4 @@ */ interface Twig_CompilerInterface { - /** - * Compiles a node. - * - * @param Twig_NodeInterface $node The node to compile - * - * @return Twig_CompilerInterface The current compiler instance - */ - public function compile(Twig_NodeInterface $node); - - /** - * Gets the current PHP code after compilation. - * - * @return string The PHP code - */ - public function getSource(); } diff --git a/lib/Twig/ExistsLoaderInterface.php b/lib/Twig/ExistsLoaderInterface.php index b168c3c35..02e273e5b 100644 --- a/lib/Twig/ExistsLoaderInterface.php +++ b/lib/Twig/ExistsLoaderInterface.php @@ -18,12 +18,4 @@ */ interface Twig_ExistsLoaderInterface { - /** - * Check if we have the source code of a template, given its name. - * - * @param string $name The name of the template to check if we can load - * - * @return bool If the template source code is handled by this loader or not - */ - public function exists($name); } diff --git a/lib/Twig/ExpressionParser.php b/lib/Twig/ExpressionParser.php index fa9fa35e8..90c3a9c83 100644 --- a/lib/Twig/ExpressionParser.php +++ b/lib/Twig/ExpressionParser.php @@ -373,7 +373,7 @@ class Twig_ExpressionParser $arg = new Twig_Node_Expression_Constant($token->getValue(), $lineno); if ($stream->test(Twig_Token::PUNCTUATION_TYPE, '(')) { - $type = Twig_TemplateInterface::METHOD_CALL; + $type = Twig_Template::METHOD_CALL; foreach ($this->parseArguments() as $n) { $arguments->addElement($n); } diff --git a/lib/Twig/LexerInterface.php b/lib/Twig/LexerInterface.php index 24a947870..1feb4f8e4 100644 --- a/lib/Twig/LexerInterface.php +++ b/lib/Twig/LexerInterface.php @@ -18,15 +18,4 @@ */ interface Twig_LexerInterface { - /** - * Tokenizes a source code. - * - * @param string $code The source code - * @param string $filename A unique identifier for the source code - * - * @return Twig_TokenStream A token stream instance - * - * @throws Twig_Error_Syntax When the code is syntactically wrong - */ - public function tokenize($code, $filename = null); } diff --git a/lib/Twig/LoaderInterface.php b/lib/Twig/LoaderInterface.php index b87058e67..29105643a 100644 --- a/lib/Twig/LoaderInterface.php +++ b/lib/Twig/LoaderInterface.php @@ -49,4 +49,13 @@ interface Twig_LoaderInterface * @throws Twig_Error_Loader When $name is not found */ public function isFresh($name, $time); + + /** + * Check if we have the source code of a template, given its name. + * + * @param string $name The name of the template to check if we can load + * + * @return bool If the template source code is handled by this loader or not + */ + public function exists($name); } diff --git a/lib/Twig/NodeInterface.php b/lib/Twig/NodeInterface.php index 8077349b3..2a7db143b 100644 --- a/lib/Twig/NodeInterface.php +++ b/lib/Twig/NodeInterface.php @@ -18,14 +18,4 @@ */ interface Twig_NodeInterface extends Countable, IteratorAggregate { - /** - * Compiles the node to PHP. - * - * @param Twig_Compiler $compiler A Twig_Compiler instance - */ - public function compile(Twig_Compiler $compiler); - - public function getLine(); - - public function getNodeTag(); } diff --git a/lib/Twig/ParserInterface.php b/lib/Twig/ParserInterface.php index 8e7cc0a85..71b2b6f6c 100644 --- a/lib/Twig/ParserInterface.php +++ b/lib/Twig/ParserInterface.php @@ -18,14 +18,4 @@ */ interface Twig_ParserInterface { - /** - * Converts a token stream to a node tree. - * - * @param Twig_TokenStream $stream A token stream instance - * - * @return Twig_Node_Module A node tree - * - * @throws Twig_Error_Syntax When the token stream is syntactically or semantically wrong - */ - public function parse(Twig_TokenStream $stream); } diff --git a/lib/Twig/Template.php b/lib/Twig/Template.php index caf96428b..58972a81e 100644 --- a/lib/Twig/Template.php +++ b/lib/Twig/Template.php @@ -17,6 +17,10 @@ */ abstract class Twig_Template implements Twig_TemplateInterface { + const ANY_CALL = 'any'; + const ARRAY_CALL = 'array'; + const METHOD_CALL = 'method'; + protected static $cache = array(); protected $parent; diff --git a/lib/Twig/TemplateInterface.php b/lib/Twig/TemplateInterface.php index d178832eb..7ba96fbe8 100644 --- a/lib/Twig/TemplateInterface.php +++ b/lib/Twig/TemplateInterface.php @@ -18,31 +18,4 @@ */ interface Twig_TemplateInterface { - const ANY_CALL = 'any'; - const ARRAY_CALL = 'array'; - const METHOD_CALL = 'method'; - - /** - * Renders the template with the given context and returns it as string. - * - * @param array $context An array of parameters to pass to the template - * - * @return string The rendered template - */ - public function render(array $context); - - /** - * Displays the template with the given context. - * - * @param array $context An array of parameters to pass to the template - * @param array $blocks An array of blocks to pass to the template - */ - public function display(array $context, array $blocks = array()); - - /** - * Returns the bound environment for this template. - * - * @return Twig_Environment The current environment - */ - public function getEnvironment(); }