mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-16 04:16:28 +00:00
various cleanups
This commit is contained in:
committed by
Fabien Potencier
parent
10da58c83b
commit
cb651e8ebb
@@ -22,7 +22,7 @@ interface Twig_ExistsLoaderInterface
|
|||||||
*
|
*
|
||||||
* @param string $name The name of the template to check if we can load
|
* @param string $name The name of the template to check if we can load
|
||||||
*
|
*
|
||||||
* @return boolean If the template source code is handled by this loader or not
|
* @return Boolean If the template source code is handled by this loader or not
|
||||||
*/
|
*/
|
||||||
public function exists($name);
|
public function exists($name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ abstract class Twig_Extension implements Twig_ExtensionInterface
|
|||||||
/**
|
/**
|
||||||
* Returns the node visitor instances to add to the existing list.
|
* Returns the node visitor instances to add to the existing list.
|
||||||
*
|
*
|
||||||
* @return array An array of Twig_NodeVisitorInterface instances
|
* @return Twig_NodeVisitorInterface[] An array of Twig_NodeVisitorInterface instances
|
||||||
*/
|
*/
|
||||||
public function getNodeVisitors()
|
public function getNodeVisitors()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ class Twig_Extension_Core extends Twig_Extension
|
|||||||
/**
|
/**
|
||||||
* Returns the token parser instance to add to the existing list.
|
* Returns the token parser instance to add to the existing list.
|
||||||
*
|
*
|
||||||
* @return array An array of Twig_TokenParser instances
|
* @return Twig_TokenParser[] An array of Twig_TokenParser instances
|
||||||
*/
|
*/
|
||||||
public function getTokenParsers()
|
public function getTokenParsers()
|
||||||
{
|
{
|
||||||
@@ -562,7 +562,7 @@ function twig_number_format_filter(Twig_Environment $env, $number, $decimal = nu
|
|||||||
* URL encodes a string as a path segment or an array as a query string.
|
* URL encodes a string as a path segment or an array as a query string.
|
||||||
*
|
*
|
||||||
* @param string|array $url A URL or an array of query parameters
|
* @param string|array $url A URL or an array of query parameters
|
||||||
* @param bool $raw true to use rawurlencode() instead of urlencode
|
* @param Boolean $raw true to use rawurlencode() instead of urlencode
|
||||||
*
|
*
|
||||||
* @return string The URL encoded value
|
* @return string The URL encoded value
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class Twig_Extension_Escaper extends Twig_Extension
|
|||||||
/**
|
/**
|
||||||
* Returns the node visitor instances to add to the existing list.
|
* Returns the node visitor instances to add to the existing list.
|
||||||
*
|
*
|
||||||
* @return array An array of Twig_NodeVisitorInterface instances
|
* @return Twig_NodeVisitorInterface[] An array of Twig_NodeVisitorInterface instances
|
||||||
*/
|
*/
|
||||||
public function getNodeVisitors()
|
public function getNodeVisitors()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class Twig_Extension_Sandbox extends Twig_Extension
|
|||||||
/**
|
/**
|
||||||
* Returns the node visitor instances to add to the existing list.
|
* Returns the node visitor instances to add to the existing list.
|
||||||
*
|
*
|
||||||
* @return array An array of Twig_NodeVisitorInterface instances
|
* @return Twig_NodeVisitorInterface[] An array of Twig_NodeVisitorInterface instances
|
||||||
*/
|
*/
|
||||||
public function getNodeVisitors()
|
public function getNodeVisitors()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ interface Twig_ExtensionInterface
|
|||||||
/**
|
/**
|
||||||
* Returns the node visitor instances to add to the existing list.
|
* Returns the node visitor instances to add to the existing list.
|
||||||
*
|
*
|
||||||
* @return array An array of Twig_NodeVisitorInterface instances
|
* @return Twig_NodeVisitorInterface[] An array of Twig_NodeVisitorInterface instances
|
||||||
*/
|
*/
|
||||||
public function getNodeVisitors();
|
public function getNodeVisitors();
|
||||||
|
|
||||||
|
|||||||
@@ -321,7 +321,6 @@ class Twig_Lexer implements Twig_LexerInterface
|
|||||||
$this->moveCursor($match[0]);
|
$this->moveCursor($match[0]);
|
||||||
|
|
||||||
} elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) {
|
} elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) {
|
||||||
|
|
||||||
list($expect, $lineno) = array_pop($this->brackets);
|
list($expect, $lineno) = array_pop($this->brackets);
|
||||||
if ($this->code[$this->cursor] != '"') {
|
if ($this->code[$this->cursor] != '"') {
|
||||||
throw new Twig_Error_Syntax(sprintf('Unclosed "%s"', $expect), $lineno, $this->filename);
|
throw new Twig_Error_Syntax(sprintf('Unclosed "%s"', $expect), $lineno, $this->filename);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
/**
|
/**
|
||||||
* Twig_NodeTraverser is a node traverser.
|
* Twig_NodeTraverser is a node traverser.
|
||||||
*
|
*
|
||||||
* It visits all nodes and their children and call the given visitor for each.
|
* It visits all nodes and their children and calls the given visitor for each.
|
||||||
*
|
*
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
*/
|
*/
|
||||||
@@ -24,8 +24,8 @@ class Twig_NodeTraverser
|
|||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param Twig_Environment $env A Twig_Environment instance
|
* @param Twig_Environment $env A Twig_Environment instance
|
||||||
* @param array $visitors An array of Twig_NodeVisitorInterface instances
|
* @param Twig_NodeVisitorInterface[] $visitors An array of Twig_NodeVisitorInterface instances
|
||||||
*/
|
*/
|
||||||
public function __construct(Twig_Environment $env, array $visitors = array())
|
public function __construct(Twig_Environment $env, array $visitors = array())
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -380,7 +380,7 @@ class Twig_Parser implements Twig_ParserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($node as $k => $n) {
|
foreach ($node as $k => $n) {
|
||||||
if (null !== $n && null === $n = $this->filterBodyNodes($n)) {
|
if (null !== $n && null === $this->filterBodyNodes($n)) {
|
||||||
$node->removeNode($k);
|
$node->removeNode($k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ class Twig_TokenStream
|
|||||||
/**
|
/**
|
||||||
* Tests the current token
|
* Tests the current token
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return Boolean
|
||||||
*/
|
*/
|
||||||
public function test($primary, $secondary = null)
|
public function test($primary, $secondary = null)
|
||||||
{
|
{
|
||||||
@@ -115,7 +115,7 @@ class Twig_TokenStream
|
|||||||
/**
|
/**
|
||||||
* Checks if end of stream was reached
|
* Checks if end of stream was reached
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return Boolean
|
||||||
*/
|
*/
|
||||||
public function isEOF()
|
public function isEOF()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user