mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/14948] Update lexer to be compatible with twig 2.6
PHPBB3-14948
This commit is contained in:
parent
7c062505aa
commit
830269dfee
1 changed files with 3 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue