mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-05 15:07:11 +00:00
Add throw tag to parse methods
This commit is contained in:
@@ -11,12 +11,16 @@
|
||||
|
||||
namespace Twig\ExpressionParser;
|
||||
|
||||
use Twig\Error\SyntaxError;
|
||||
use Twig\Node\Expression\AbstractExpression;
|
||||
use Twig\Parser;
|
||||
use Twig\Token;
|
||||
|
||||
interface InfixExpressionParserInterface extends ExpressionParserInterface
|
||||
{
|
||||
/**
|
||||
* @throws SyntaxError
|
||||
*/
|
||||
public function parse(Parser $parser, AbstractExpression $left, Token $token): AbstractExpression;
|
||||
|
||||
public function getAssociativity(): InfixAssociativity;
|
||||
|
||||
@@ -11,11 +11,15 @@
|
||||
|
||||
namespace Twig\ExpressionParser;
|
||||
|
||||
use Twig\Error\SyntaxError;
|
||||
use Twig\Node\Expression\AbstractExpression;
|
||||
use Twig\Parser;
|
||||
use Twig\Token;
|
||||
|
||||
interface PrefixExpressionParserInterface extends ExpressionParserInterface
|
||||
{
|
||||
/**
|
||||
* @throws SyntaxError
|
||||
*/
|
||||
public function parse(Parser $parser, Token $token): AbstractExpression;
|
||||
}
|
||||
|
||||
@@ -76,6 +76,9 @@ class Parser
|
||||
return \sprintf('__internal_parse_%d', $this->varNameSalt++);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws SyntaxError
|
||||
*/
|
||||
public function parse(TokenStream $stream, $test = null, bool $dropNeedle = false): ModuleNode
|
||||
{
|
||||
$vars = get_object_vars($this);
|
||||
@@ -158,6 +161,9 @@ class Parser
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws SyntaxError
|
||||
*/
|
||||
public function subparse($test, bool $dropNeedle = false): Node
|
||||
{
|
||||
$lineno = $this->getCurrentToken()->getLine();
|
||||
|
||||
Reference in New Issue
Block a user