1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-16 13:44:12 +02:00

[ticket/16654] Upgrade Twig to version 3

PHPBB3-16654
This commit is contained in:
rxu
2020-12-01 13:10:45 +07:00
parent 382c7acbc8
commit 1d9f9b5ecd
14 changed files with 83 additions and 79 deletions

View File

@@ -65,7 +65,7 @@ class event extends \Twig\Node\Node
// We set the namespace lookup order to be this extension first, then the main path
->write("\$this->env->setNamespaceLookUpOrder(array('{$ext_namespace}', '__main__'));\n")
->write("\$this->env->loadTemplate('@{$ext_namespace}/{$location}.html')->display(\$context);\n")
->write("\$this->env->loadTemplate(\$this->env->getTemplateClass('@{$ext_namespace}/{$location}.html'), '@{$ext_namespace}/{$location}.html')->display(\$context);\n")
->write("\$this->env->setNamespaceLookUpOrder(\$previous_look_up_order);\n")
;
}

View File

@@ -15,7 +15,7 @@ namespace phpbb\template\twig\node\expression\binary;
class equalequal extends \Twig\Node\Expression\Binary\AbstractBinary
{
public function operator(\Twig\Compiler $compiler)
public function operator(\Twig\Compiler $compiler) : \Twig\Compiler
{
return $compiler->raw('===');
}

View File

@@ -15,7 +15,7 @@ namespace phpbb\template\twig\node\expression\binary;
class notequalequal extends \Twig\Node\Expression\Binary\AbstractBinary
{
public function operator(\Twig\Compiler $compiler)
public function operator(\Twig\Compiler $compiler) : \Twig\Compiler
{
return $compiler->raw('!==');
}

View File

@@ -20,7 +20,7 @@ class includenode extends \Twig\Node\IncludeNode
*
* @param \Twig\Compiler A Twig\Compiler instance
*/
public function compile(\Twig\Compiler $compiler)
public function compile(\Twig\Compiler $compiler) : void
{
$compiler->addDebugInfo($this);