1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-07 01:06:48 +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

@@ -16,6 +16,19 @@ namespace phpbb\template\twig\tokenparser;
class includephp 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.
*
@@ -40,7 +53,7 @@ class includephp extends \Twig_TokenParser
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
return new \phpbb\template\twig\node\includephp($expr, $this->parser->getEnvironment(), $token->getLine(), $ignoreMissing, $this->getTag());
return new \phpbb\template\twig\node\includephp($expr, $this->environment, $token->getLine(), $ignoreMissing, $this->getTag());
}
/**