Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
includeparser
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 parse
100.00% covered (success)
100.00%
3 / 3
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* @copyright Portions (c) 2009 Fabien Potencier, Armin Ronacher
8* @license GNU General Public License, version 2 (GPL-2.0)
9*
10* For full copyright and license information, please see
11* the docs/CREDITS.txt file.
12*
13*/
14
15namespace phpbb\template\twig\tokenparser;
16
17class includeparser extends \Twig\TokenParser\IncludeTokenParser
18{
19    /**
20    * Parses a token and returns a node.
21    *
22    * @param \Twig\Token $token A Twig\Token instance
23    *
24    * @return \Twig\Node\Node A Twig\Node instance
25    */
26    public function parse(\Twig\Token $token) : \Twig\Node\Node
27    {
28        $expr = $this->parser->getExpressionParser()->parseExpression();
29
30        list($variables, $only, $ignoreMissing) = $this->parseArguments();
31
32        return new \phpbb\template\twig\node\includenode($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag());
33    }
34
35    /**
36    * Gets the tag name associated with this token parser.
37    *
38    * @return string The tag name
39    */
40    public function getTag() : string
41    {
42        return 'INCLUDE';
43    }
44}