Coding style

- Unnecessary return in Lexer
- Typo in TokenParserBrokerInterface
This commit is contained in:
Steven Hoffman
2012-05-10 12:10:26 -07:00
parent e445192f06
commit 6c06a32663
7 changed files with 15 additions and 8 deletions
+2 -1
View File
@@ -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())
{
+2 -1
View File
@@ -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())
{
+2 -2
View File
@@ -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;
}
}
+5 -1
View File
@@ -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('_')
;
}
}
+1 -1
View File
@@ -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') {
+2 -1
View File
@@ -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)
{
+1 -1
View File
@@ -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();
}