From cb651e8ebbafeb9550b4ecb67f6d69c1d8a6a687 Mon Sep 17 00:00:00 2001 From: Luis Cordova Date: Mon, 11 Nov 2013 23:16:28 -0500 Subject: [PATCH] various cleanups --- lib/Twig/ExistsLoaderInterface.php | 2 +- lib/Twig/Extension.php | 2 +- lib/Twig/Extension/Core.php | 4 ++-- lib/Twig/Extension/Escaper.php | 2 +- lib/Twig/Extension/Sandbox.php | 2 +- lib/Twig/ExtensionInterface.php | 2 +- lib/Twig/Lexer.php | 1 - lib/Twig/NodeTraverser.php | 6 +++--- lib/Twig/Parser.php | 2 +- lib/Twig/TokenStream.php | 4 ++-- 10 files changed, 13 insertions(+), 14 deletions(-) diff --git a/lib/Twig/ExistsLoaderInterface.php b/lib/Twig/ExistsLoaderInterface.php index ce43476..da05a54 100644 --- a/lib/Twig/ExistsLoaderInterface.php +++ b/lib/Twig/ExistsLoaderInterface.php @@ -22,7 +22,7 @@ interface Twig_ExistsLoaderInterface * * @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); } diff --git a/lib/Twig/Extension.php b/lib/Twig/Extension.php index 931fc03..5c8ad5c 100644 --- a/lib/Twig/Extension.php +++ b/lib/Twig/Extension.php @@ -34,7 +34,7 @@ abstract class Twig_Extension implements Twig_ExtensionInterface /** * 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() { diff --git a/lib/Twig/Extension/Core.php b/lib/Twig/Extension/Core.php index bb5ad0c..85ba685 100644 --- a/lib/Twig/Extension/Core.php +++ b/lib/Twig/Extension/Core.php @@ -117,7 +117,7 @@ class Twig_Extension_Core extends Twig_Extension /** * 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() { @@ -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. * * @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 */ diff --git a/lib/Twig/Extension/Escaper.php b/lib/Twig/Extension/Escaper.php index c9a7f68..d3e5ad0 100644 --- a/lib/Twig/Extension/Escaper.php +++ b/lib/Twig/Extension/Escaper.php @@ -30,7 +30,7 @@ class Twig_Extension_Escaper extends Twig_Extension /** * 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() { diff --git a/lib/Twig/Extension/Sandbox.php b/lib/Twig/Extension/Sandbox.php index bf76c11..c59609f 100644 --- a/lib/Twig/Extension/Sandbox.php +++ b/lib/Twig/Extension/Sandbox.php @@ -33,7 +33,7 @@ class Twig_Extension_Sandbox extends Twig_Extension /** * 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() { diff --git a/lib/Twig/ExtensionInterface.php b/lib/Twig/ExtensionInterface.php index f189e9d..49541b0 100644 --- a/lib/Twig/ExtensionInterface.php +++ b/lib/Twig/ExtensionInterface.php @@ -35,7 +35,7 @@ interface Twig_ExtensionInterface /** * 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(); diff --git a/lib/Twig/Lexer.php b/lib/Twig/Lexer.php index 72fbc66..8955fca 100644 --- a/lib/Twig/Lexer.php +++ b/lib/Twig/Lexer.php @@ -321,7 +321,6 @@ class Twig_Lexer implements Twig_LexerInterface $this->moveCursor($match[0]); } elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) { - list($expect, $lineno) = array_pop($this->brackets); if ($this->code[$this->cursor] != '"') { throw new Twig_Error_Syntax(sprintf('Unclosed "%s"', $expect), $lineno, $this->filename); diff --git a/lib/Twig/NodeTraverser.php b/lib/Twig/NodeTraverser.php index 28cba1a..aacaf29 100644 --- a/lib/Twig/NodeTraverser.php +++ b/lib/Twig/NodeTraverser.php @@ -12,7 +12,7 @@ /** * 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 */ @@ -24,8 +24,8 @@ class Twig_NodeTraverser /** * Constructor. * - * @param Twig_Environment $env A Twig_Environment instance - * @param array $visitors An array of Twig_NodeVisitorInterface instances + * @param Twig_Environment $env A Twig_Environment instance + * @param Twig_NodeVisitorInterface[] $visitors An array of Twig_NodeVisitorInterface instances */ public function __construct(Twig_Environment $env, array $visitors = array()) { diff --git a/lib/Twig/Parser.php b/lib/Twig/Parser.php index 73f197f..549ce2b 100644 --- a/lib/Twig/Parser.php +++ b/lib/Twig/Parser.php @@ -380,7 +380,7 @@ class Twig_Parser implements Twig_ParserInterface } foreach ($node as $k => $n) { - if (null !== $n && null === $n = $this->filterBodyNodes($n)) { + if (null !== $n && null === $this->filterBodyNodes($n)) { $node->removeNode($k); } } diff --git a/lib/Twig/TokenStream.php b/lib/Twig/TokenStream.php index a78189f..1fd65ea 100644 --- a/lib/Twig/TokenStream.php +++ b/lib/Twig/TokenStream.php @@ -105,7 +105,7 @@ class Twig_TokenStream /** * Tests the current token * - * @return bool + * @return Boolean */ public function test($primary, $secondary = null) { @@ -115,7 +115,7 @@ class Twig_TokenStream /** * Checks if end of stream was reached * - * @return bool + * @return Boolean */ public function isEOF() { -- 1.7.2.5