diff options
Diffstat (limited to 'phpBB/phpbb/template/twig/tokenparser/defineparser.php')
-rw-r--r-- | phpBB/phpbb/template/twig/tokenparser/defineparser.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/phpBB/phpbb/template/twig/tokenparser/defineparser.php b/phpBB/phpbb/template/twig/tokenparser/defineparser.php index db023c67bf..688afec191 100644 --- a/phpBB/phpbb/template/twig/tokenparser/defineparser.php +++ b/phpBB/phpbb/template/twig/tokenparser/defineparser.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\template\twig\tokenparser; + /** * @ignore */ @@ -16,7 +18,7 @@ if (!defined('IN_PHPBB')) } -class phpbb_template_twig_tokenparser_defineparser extends Twig_TokenParser +class defineparser extends \Twig_TokenParser { /** * Parses a token and returns a node. @@ -25,31 +27,31 @@ class phpbb_template_twig_tokenparser_defineparser extends Twig_TokenParser * * @return Twig_NodeInterface A Twig_NodeInterface instance */ - public function parse(Twig_Token $token) + public function parse(\Twig_Token $token) { $lineno = $token->getLine(); $stream = $this->parser->getStream(); $name = $this->parser->getExpressionParser()->parseExpression(); $capture = false; - if ($stream->test(Twig_Token::OPERATOR_TYPE, '=')) { + if ($stream->test(\Twig_Token::OPERATOR_TYPE, '=')) { $stream->next(); $value = $this->parser->getExpressionParser()->parseExpression(); - $stream->expect(Twig_Token::BLOCK_END_TYPE); + $stream->expect(\Twig_Token::BLOCK_END_TYPE); } else { $capture = true; - $stream->expect(Twig_Token::BLOCK_END_TYPE); + $stream->expect(\Twig_Token::BLOCK_END_TYPE); $value = $this->parser->subparse(array($this, 'decideBlockEnd'), true); - $stream->expect(Twig_Token::BLOCK_END_TYPE); + $stream->expect(\Twig_Token::BLOCK_END_TYPE); } - return new phpbb_template_twig_node_definenode($capture, $name, $value, $lineno, $this->getTag()); + return new \phpbb\template\twig\node\definenode($capture, $name, $value, $lineno, $this->getTag()); } - public function decideBlockEnd(Twig_Token $token) + public function decideBlockEnd(\Twig_Token $token) { return $token->test('ENDDEFINE'); } |