From: Steven Hoffman Date: Thu, 10 May 2012 19:10:26 +0000 (-0700) Subject: Coding style X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=6c06a32663967de0b4aae5358bd02e4a1bfb9852;p=web%2Fkonrad%2Ftwig.git Coding style - Unnecessary return in Lexer - Typo in TokenParserBrokerInterface --- diff --git a/lib/Twig/Filter/Method.php b/lib/Twig/Filter/Method.php index d831e0f..a680f61 100644 --- a/lib/Twig/Filter/Method.php +++ b/lib/Twig/Filter/Method.php @@ -17,7 +17,8 @@ */ class Twig_Filter_Method extends Twig_Filter { - protected $extension, $method; + protected $extension; + protected $method; public function __construct(Twig_ExtensionInterface $extension, $method, array $options = array()) { diff --git a/lib/Twig/Function/Method.php b/lib/Twig/Function/Method.php index 7328566..8838618 100644 --- a/lib/Twig/Function/Method.php +++ b/lib/Twig/Function/Method.php @@ -18,7 +18,8 @@ */ class Twig_Function_Method extends Twig_Function { - protected $extension, $method; + protected $extension; + protected $method; public function __construct(Twig_ExtensionInterface $extension, $method, array $options = array()) { diff --git a/lib/Twig/Lexer.php b/lib/Twig/Lexer.php index 4d0ba9f..269692d 100644 --- a/lib/Twig/Lexer.php +++ b/lib/Twig/Lexer.php @@ -30,6 +30,8 @@ class Twig_Lexer implements Twig_LexerInterface protected $filename; protected $options; protected $regexes; + protected $position; + protected $positions; const STATE_DATA = 0; const STATE_BLOCK = 1; @@ -330,8 +332,6 @@ class Twig_Lexer implements Twig_LexerInterface $this->popState(); ++$this->cursor; - - return; } } diff --git a/lib/Twig/Node/Expression/TempName.php b/lib/Twig/Node/Expression/TempName.php index eea9d47..e6b058e 100644 --- a/lib/Twig/Node/Expression/TempName.php +++ b/lib/Twig/Node/Expression/TempName.php @@ -17,6 +17,10 @@ class Twig_Node_Expression_TempName extends Twig_Node_Expression public function compile(Twig_Compiler $compiler) { - $compiler->raw('$_')->raw($this->getAttribute('name'))->raw('_'); + $compiler + ->raw('$_') + ->raw($this->getAttribute('name')) + ->raw('_') + ; } } diff --git a/lib/Twig/NodeVisitor/Optimizer.php b/lib/Twig/NodeVisitor/Optimizer.php index cbc61fc..c9ad6bb 100644 --- a/lib/Twig/NodeVisitor/Optimizer.php +++ b/lib/Twig/NodeVisitor/Optimizer.php @@ -56,7 +56,7 @@ class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface $this->enterOptimizeFor($node, $env); } - if (!version_compare(phpversion(), '5.4.0RC1', '>=') && self::OPTIMIZE_VAR_ACCESS === (self::OPTIMIZE_VAR_ACCESS & $this->optimizers) && !$env->isStrictVariables() && !$env->hasExtension('sandbox')) { + if (!version_compare(phpversion(), '5.4.0RC1', '>=') && self::OPTIMIZE_VAR_ACCESS === (self::OPTIMIZE_VAR_ACCESS & $this->optimizers) && !$env->isStrictVariables() && !$env->hasExtension('sandbox')) { if ($this->inABody) { if (!$node instanceof Twig_Node_Expression) { if (get_class($node) !== 'Twig_Node') { diff --git a/lib/Twig/Test/Method.php b/lib/Twig/Test/Method.php index a3b3948..a8d1d9b 100644 --- a/lib/Twig/Test/Method.php +++ b/lib/Twig/Test/Method.php @@ -17,7 +17,8 @@ */ class Twig_Test_Method implements Twig_TestInterface { - protected $extension, $method; + protected $extension; + protected $method; public function __construct(Twig_ExtensionInterface $extension, $method) { diff --git a/lib/Twig/TokenParserBrokerInterface.php b/lib/Twig/TokenParserBrokerInterface.php index 3ce8ca2..899356a 100644 --- a/lib/Twig/TokenParserBrokerInterface.php +++ b/lib/Twig/TokenParserBrokerInterface.php @@ -39,7 +39,7 @@ interface Twig_TokenParserBrokerInterface /** * Gets the Twig_ParserInterface. * - * @return null|Twig_ParserInterface A Twig_ParserInterface instance of null + * @return null|Twig_ParserInterface A Twig_ParserInterface instance or null */ function getParser(); }