mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-14 13:46:33 +02:00
[ticket/14948] Update lexer to be compatible with twig 2.6
PHPBB3-14948
This commit is contained in:
@ -15,20 +15,10 @@ namespace phpbb\template\twig;
|
|||||||
|
|
||||||
class lexer extends \Twig_Lexer
|
class lexer extends \Twig_Lexer
|
||||||
{
|
{
|
||||||
public function set_environment(\Twig_Environment $env)
|
public function tokenize(\Twig_Source $source)
|
||||||
{
|
{
|
||||||
$this->env = $env;
|
$code = $source->getCode();
|
||||||
}
|
$filename = $source->getName();
|
||||||
|
|
||||||
public function tokenize($code, $filename = null)
|
|
||||||
{
|
|
||||||
// Handle \Twig_Source format input
|
|
||||||
if ($code instanceof \Twig_Source)
|
|
||||||
{
|
|
||||||
$source = $code;
|
|
||||||
$code = $source->getCode();
|
|
||||||
$filename = $source->getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Our phpBB tags
|
// Our phpBB tags
|
||||||
// Commented out tokens are handled separately from the main replace
|
// Commented out tokens are handled separately from the main replace
|
||||||
|
Reference in New Issue
Block a user