From 81ebebb2102d37b251f11db5398105c5955eff05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Andr=C3=A9?= Date: Thu, 2 Jan 2025 07:17:52 +0100 Subject: [PATCH] Remove dead method in ModuleNode This method is not used after 1.x (it was used in the compileConstructor)https://github.com/twigphp/Twig/blob/b1f009c449e435a0384814e67205d9190a4d050e/src/Node/ModuleNode.php#L206 and has no caller since 2.x https://github.com/twigphp/Twig/blob/19185947ec75d433a3ac650af32fc05649b95ee1/src/Node/ModuleNode.php#L174 ModuleNode is marked final so I guess we can remove it safely. --- src/Node/ModuleNode.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/Node/ModuleNode.php b/src/Node/ModuleNode.php index 17840dd0a..9e2774e87 100644 --- a/src/Node/ModuleNode.php +++ b/src/Node/ModuleNode.php @@ -473,21 +473,4 @@ final class ModuleNode extends Node ->write("}\n") ; } - - protected function compileLoadTemplate(Compiler $compiler, $node, $var) - { - if ($node instanceof ConstantExpression) { - $compiler - ->write(\sprintf('%s = $this->loadTemplate(', $var)) - ->subcompile($node) - ->raw(', ') - ->repr($node->getTemplateName()) - ->raw(', ') - ->repr($node->getTemplateLine()) - ->raw(");\n") - ; - } else { - throw new \LogicException('Trait templates can only be constant nodes.'); - } - } }