1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-22 02:55:41 +02:00

[ticket/15508] Remove call to getEnvironment() from parser

PHPBB3-15508
This commit is contained in:
François-Xavier de Guillebon
2018-01-16 12:46:48 +01:00
parent e75077fc5b
commit 23b13c239b
17 changed files with 78 additions and 39 deletions

View File

@ -15,6 +15,19 @@ namespace phpbb\template\twig\tokenparser;
class php extends \Twig_TokenParser
{
/** @var \phpbb\template\twig\environment */
protected $environment;
/**
* Constructor
*
* @param \phpbb\template\twig\environment $environment
*/
public function __construct(\phpbb\template\twig\environment $environment)
{
$this->environment = $environment;
}
/**
* Parses a token and returns a node.
*
@ -32,7 +45,7 @@ class php extends \Twig_TokenParser
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
return new \phpbb\template\twig\node\php($body, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
return new \phpbb\template\twig\node\php($body, $this->environment, $token->getLine(), $this->getTag());
}
public function decideEnd(\Twig_Token $token)