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:
@ -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)
|
||||
|
Reference in New Issue
Block a user