aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/template/twig/tokenparser/php.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/template/twig/tokenparser/php.php')
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/php.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/phpBB/phpbb/template/twig/tokenparser/php.php b/phpBB/phpbb/template/twig/tokenparser/php.php
index f11ce35896..3007912b47 100644
--- a/phpBB/phpbb/template/twig/tokenparser/php.php
+++ b/phpBB/phpbb/template/twig/tokenparser/php.php
@@ -15,12 +15,25 @@ 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.
*
* @param \Twig_Token $token A Twig_Token instance
*
- * @return \Twig_NodeInterface A Twig_NodeInterface instance
+ * @return \Twig_Node A Twig_Node instance
*/
public function parse(\Twig_Token $token)
{
@@ -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)