phpBB

Code Changes

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

  Unmodified   Added   Modified   Removed
Line 13Line 13

namespace phpbb\template\twig\tokenparser;



namespace phpbb\template\twig\tokenparser;


class php extends \Twig_TokenParser

class php extends \Twig\TokenParser\AbstractTokenParser

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

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

Line 31Line 31
	/**
* 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)

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


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


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

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


$body = $this->parser->subparse(array($this, 'decideEnd'), true);



$body = $this->parser->subparse(array($this, 'decideEnd'), true);


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

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


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



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


	public function decideEnd(\Twig_Token $token)

	public function decideEnd(\Twig\Token $token)

	{
return $token->test('ENDPHP');
}

	{
return $token->test('ENDPHP');
}