mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-20 06:29:03 +00:00
emptied deprecated interfaces
This commit is contained in:
@@ -18,19 +18,4 @@
|
|||||||
*/
|
*/
|
||||||
interface Twig_CompilerInterface
|
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();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,12 +18,4 @@
|
|||||||
*/
|
*/
|
||||||
interface Twig_ExistsLoaderInterface
|
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);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -373,7 +373,7 @@ class Twig_ExpressionParser
|
|||||||
$arg = new Twig_Node_Expression_Constant($token->getValue(), $lineno);
|
$arg = new Twig_Node_Expression_Constant($token->getValue(), $lineno);
|
||||||
|
|
||||||
if ($stream->test(Twig_Token::PUNCTUATION_TYPE, '(')) {
|
if ($stream->test(Twig_Token::PUNCTUATION_TYPE, '(')) {
|
||||||
$type = Twig_TemplateInterface::METHOD_CALL;
|
$type = Twig_Template::METHOD_CALL;
|
||||||
foreach ($this->parseArguments() as $n) {
|
foreach ($this->parseArguments() as $n) {
|
||||||
$arguments->addElement($n);
|
$arguments->addElement($n);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,15 +18,4 @@
|
|||||||
*/
|
*/
|
||||||
interface Twig_LexerInterface
|
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);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,4 +49,13 @@ interface Twig_LoaderInterface
|
|||||||
* @throws Twig_Error_Loader When $name is not found
|
* @throws Twig_Error_Loader When $name is not found
|
||||||
*/
|
*/
|
||||||
public function isFresh($name, $time);
|
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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,14 +18,4 @@
|
|||||||
*/
|
*/
|
||||||
interface Twig_NodeInterface extends Countable, IteratorAggregate
|
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();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,14 +18,4 @@
|
|||||||
*/
|
*/
|
||||||
interface Twig_ParserInterface
|
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);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,10 @@
|
|||||||
*/
|
*/
|
||||||
abstract class Twig_Template implements Twig_TemplateInterface
|
abstract class Twig_Template implements Twig_TemplateInterface
|
||||||
{
|
{
|
||||||
|
const ANY_CALL = 'any';
|
||||||
|
const ARRAY_CALL = 'array';
|
||||||
|
const METHOD_CALL = 'method';
|
||||||
|
|
||||||
protected static $cache = array();
|
protected static $cache = array();
|
||||||
|
|
||||||
protected $parent;
|
protected $parent;
|
||||||
|
|||||||
@@ -18,31 +18,4 @@
|
|||||||
*/
|
*/
|
||||||
interface Twig_TemplateInterface
|
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();
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user