1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-14 04:42:04 +02:00

[ticket/14948] Update lexer to be compatible with twig 2.6

PHPBB3-14948
This commit is contained in:
Marc Alexander 2018-12-30 16:31:09 +01:00
parent e7795fe7ce
commit 9f19202152
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995

View File

@ -15,20 +15,10 @@ namespace phpbb\template\twig;
class lexer extends \Twig_Lexer
{
public function set_environment(\Twig_Environment $env)
public function tokenize(\Twig_Source $source)
{
$this->env = $env;
}
public function tokenize($code, $filename = null)
{
// Handle \Twig_Source format input
if ($code instanceof \Twig_Source)
{
$source = $code;
$code = $source->getCode();
$filename = $source->getName();
}
$code = $source->getCode();
$filename = $source->getName();
// Our phpBB tags
// Commented out tokens are handled separately from the main replace