aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/template/twig/tokenparser/event.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/template/twig/tokenparser/event.php')
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/event.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/phpBB/phpbb/template/twig/tokenparser/event.php b/phpBB/phpbb/template/twig/tokenparser/event.php
index f73ef4ae25..92ecff4a74 100644
--- a/phpBB/phpbb/template/twig/tokenparser/event.php
+++ b/phpBB/phpbb/template/twig/tokenparser/event.php
@@ -15,12 +15,25 @@ namespace phpbb\template\twig\tokenparser;
class event 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)
{
@@ -29,7 +42,7 @@ class event extends \Twig_TokenParser
$stream = $this->parser->getStream();
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
- return new \phpbb\template\twig\node\event($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
+ return new \phpbb\template\twig\node\event($expr, $this->environment, $token->getLine(), $this->getTag());
}
/**