phpBB

Code Changes

File: phpbb/template/twig/tokenparser/includephp.php

  Unmodified   Added   Modified   Removed
Line 14Line 14

namespace phpbb\template\twig\tokenparser;



namespace phpbb\template\twig\tokenparser;


class includephp extends \Twig_TokenParser

class includephp extends \Twig\TokenParser\AbstractTokenParser

{
/** @var \phpbb\template\twig\environment */
protected $environment;

{
/** @var \phpbb\template\twig\environment */
protected $environment;

Line 32Line 32
	/**
* Parses a token and returns a node.
*

	/**
* Parses a token and returns a node.
*

	* @param \Twig_Token $token A Twig_Token instance

	* @param \Twig\Token $token A Twig\Token instance

	*

	*

	* @return \Twig_Node A Twig_Node instance

	* @return \Twig\Node\Node A Twig\Node instance

	*/

	*/

	public function parse(\Twig_Token $token)

	public function parse(\Twig\Token $token)

	{
$expr = $this->parser->getExpressionParser()->parseExpression();

$stream = $this->parser->getStream();

$ignoreMissing = false;

	{
$expr = $this->parser->getExpressionParser()->parseExpression();

$stream = $this->parser->getStream();

$ignoreMissing = false;

		if ($stream->test(\Twig_Token::NAME_TYPE, 'ignore'))

		if ($stream->test(\Twig\Token::NAME_TYPE, 'ignore'))

		{
$stream->next();

		{
$stream->next();

			$stream->expect(\Twig_Token::NAME_TYPE, 'missing');

			$stream->expect(\Twig\Token::NAME_TYPE, 'missing');


$ignoreMissing = true;
}



$ignoreMissing = true;
}


		$stream->expect(\Twig_Token::BLOCK_END_TYPE);

		$stream->expect(\Twig\Token::BLOCK_END_TYPE);


return new \phpbb\template\twig\node\includephp($expr, $this->environment, $token->getLine(), $ignoreMissing, $this->getTag());
}


return new \phpbb\template\twig\node\includephp($expr, $this->environment, $token->getLine(), $ignoreMissing, $this->getTag());
}