Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
event
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 parse
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
 getTag
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3*
4* This file is part of the phpBB Forum Software package.
5*
6* @copyright (c) phpBB Limited <https://www.phpbb.com>
7* @license GNU General Public License, version 2 (GPL-2.0)
8*
9* For full copyright and license information, please see
10* the docs/CREDITS.txt file.
11*
12*/
13
14namespace phpbb\template\twig\tokenparser;
15
16class event extends \Twig\TokenParser\AbstractTokenParser
17{
18    /** @var \phpbb\template\twig\environment */
19    protected $environment;
20
21    /**
22    * Constructor
23    *
24    * @param \phpbb\template\twig\environment $environment
25    */
26    public function __construct(\phpbb\template\twig\environment $environment)
27    {
28        $this->environment = $environment;
29    }
30
31    /**
32    * Parses a token and returns a node.
33    *
34    * @param \Twig\Token $token A Twig\Token instance
35    *
36    * @return \Twig\Node\Node A Twig\Node instance
37    */
38    public function parse(\Twig\Token $token)
39    {
40        $expr = $this->parser->getExpressionParser()->parseExpression();
41
42        $stream = $this->parser->getStream();
43        $stream->expect(\Twig\Token::BLOCK_END_TYPE);
44
45        return new \phpbb\template\twig\node\event($expr, $this->environment, $token->getLine(), $this->getTag());
46    }
47
48    /**
49    * Gets the tag name associated with this token parser.
50    *
51    * @return string The tag name
52    */
53    public function getTag()
54    {
55        return 'EVENT';
56    }
57}