mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-31 04:27:00 +00:00
Coding style
- Unnecessary return in Lexer - Typo in TokenParserBrokerInterface
This commit is contained in:
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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('_')
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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') {
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user