1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-12 03:34:04 +02:00

[ticket/16382] Update Twig_Token

PHPBB3-16382
This commit is contained in:
mrgoldy
2020-02-27 16:42:44 +01:00
parent dbb9cbe280
commit b795b8a040
7 changed files with 28 additions and 28 deletions

View File

@@ -32,26 +32,26 @@ class includephp extends \Twig_TokenParser
/**
* Parses a token and returns a node.
*
* @param \Twig_Token $token A Twig_Token instance
* @param \Twig\Token $token A Twig_Token instance
*
* @return \Twig_Node A Twig_Node instance
*/
public function parse(\Twig_Token $token)
public function parse(\Twig\Token $token)
{
$expr = $this->parser->getExpressionParser()->parseExpression();
$stream = $this->parser->getStream();
$ignoreMissing = false;
if ($stream->test(\Twig_Token::NAME_TYPE, 'ignore'))
if ($stream->test(\Twig\Token::NAME_TYPE, 'ignore'))
{
$stream->next();
$stream->expect(\Twig_Token::NAME_TYPE, 'missing');
$stream->expect(\Twig\Token::NAME_TYPE, 'missing');
$ignoreMissing = true;
}
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
$stream->expect(\Twig\Token::BLOCK_END_TYPE);
return new \phpbb\template\twig\node\includephp($expr, $this->environment, $token->getLine(), $ignoreMissing, $this->getTag());
}