mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/15508] Remove call to getEnvironment() from parser
PHPBB3-15508
This commit is contained in:
committed by
Marc Alexander
parent
ff35f65064
commit
40e61e4d1e
@@ -15,6 +15,19 @@ 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.
|
||||
*
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -29,7 +29,7 @@ class includecss extends \Twig_TokenParser
|
||||
$stream = $this->parser->getStream();
|
||||
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
|
||||
|
||||
return new \phpbb\template\twig\node\includecss($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
|
||||
return new \phpbb\template\twig\node\includecss($expr, $token->getLine(), $this->getTag());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -29,7 +29,7 @@ class includejs extends \Twig_TokenParser
|
||||
$stream = $this->parser->getStream();
|
||||
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
|
||||
|
||||
return new \phpbb\template\twig\node\includejs($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
|
||||
return new \phpbb\template\twig\node\includejs($expr, $token->getLine(), $this->getTag());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -16,6 +16,19 @@ namespace phpbb\template\twig\tokenparser;
|
||||
|
||||
class includephp 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.
|
||||
*
|
||||
@@ -40,7 +53,7 @@ class includephp extends \Twig_TokenParser
|
||||
|
||||
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
|
||||
|
||||
return new \phpbb\template\twig\node\includephp($expr, $this->parser->getEnvironment(), $token->getLine(), $ignoreMissing, $this->getTag());
|
||||
return new \phpbb\template\twig\node\includephp($expr, $this->environment, $token->getLine(), $ignoreMissing, $this->getTag());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -15,6 +15,19 @@ namespace phpbb\template\twig\tokenparser;
|
||||
|
||||
class php 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.
|
||||
*
|
||||
@@ -32,7 +45,7 @@ class php extends \Twig_TokenParser
|
||||
|
||||
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
|
||||
|
||||
return new \phpbb\template\twig\node\php($body, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
|
||||
return new \phpbb\template\twig\node\php($body, $this->environment, $token->getLine(), $this->getTag());
|
||||
}
|
||||
|
||||
public function decideEnd(\Twig_Token $token)
|
||||
|
Reference in New Issue
Block a user