This commit is contained in:
Fabien Potencier
2025-02-14 13:03:18 +01:00
parent 38c52534cc
commit 9a0f896cd0
8 changed files with 3 additions and 15 deletions
@@ -15,7 +15,6 @@ use Twig\ExpressionParser\AbstractExpressionParser;
use Twig\ExpressionParser\ExpressionParserDescriptionInterface;
use Twig\ExpressionParser\InfixAssociativity;
use Twig\ExpressionParser\InfixExpressionParserInterface;
use Twig\ExpressionParser\PrecedenceChange;
use Twig\Node\EmptyNode;
use Twig\Node\Expression\AbstractExpression;
use Twig\Parser;
@@ -83,7 +83,6 @@ final class LiteralExpressionParser extends AbstractExpressionParser implements
default => throw new SyntaxError(\sprintf('Unexpected token "%s" of value "%s".', $token->toEnglish(), $token->getValue()), $token->getLine(), $stream->getSourceContext()),
};
// no break
case $token->test(Token::OPERATOR_TYPE):
if ('[' === $token->getValue()) {
return $this->parseSequenceExpression($parser);
+1 -1
View File
@@ -80,8 +80,8 @@ use Twig\Node\Expression\Test\SameasTest;
use Twig\Node\Expression\Unary\NegUnary;
use Twig\Node\Expression\Unary\NotUnary;
use Twig\Node\Expression\Unary\PosUnary;
use Twig\Node\Expression\Variable\ContextVariable;
use Twig\Node\Expression\Unary\SpreadUnary;
use Twig\Node\Expression\Variable\ContextVariable;
use Twig\Node\Node;
use Twig\Parser;
use Twig\Sandbox\SecurityNotAllowedMethodError;
+1 -1
View File
@@ -28,7 +28,7 @@ final class EscaperExtension extends AbstractExtension
* @see setDefaultStrategy()
*/
public function __construct(
private $defaultStrategy = 'html'
private $defaultStrategy = 'html',
) {
$this->setDefaultStrategy($defaultStrategy);
}
-1
View File
@@ -12,7 +12,6 @@
namespace Twig\Extension;
use Twig\ExpressionParser\ExpressionParserInterface;
use Twig\ExpressionParser\PrecedenceChange;
use Twig\NodeVisitor\NodeVisitorInterface;
use Twig\TokenParser\TokenParserInterface;
use Twig\TwigFilter;
-6
View File
@@ -13,16 +13,10 @@ namespace Twig;
use Twig\Error\RuntimeError;
use Twig\ExpressionParser\ExpressionParsers;
use Twig\ExpressionParser\Infix\BinaryOperatorExpressionParser;
use Twig\ExpressionParser\InfixAssociativity;
use Twig\ExpressionParser\InfixExpressionParserInterface;
use Twig\ExpressionParser\PrecedenceChange;
use Twig\ExpressionParser\Prefix\UnaryOperatorExpressionParser;
use Twig\Extension\ExtensionInterface;
use Twig\Extension\GlobalsInterface;
use Twig\Extension\LastModifiedExtensionInterface;
use Twig\Extension\StagingExtension;
use Twig\Node\Expression\AbstractExpression;
use Twig\NodeVisitor\NodeVisitorInterface;
use Twig\TokenParser\TokenParserInterface;
+1 -1
View File
@@ -36,6 +36,6 @@ class ForElseNode extends Node
->subcompile($this->getNode('body'))
->outdent()
->write("}\n")
;
;
}
}
-3
View File
@@ -73,9 +73,6 @@ final class Token
return $this->lineno;
}
/**
* @return mixed
*/
public function getValue()
{
return $this->value;