Skip to content

Commit

Permalink
Remove dead method in ModuleNode
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
smnandre committed Jan 2, 2025
1 parent d184e9f commit 81ebebb
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/Node/ModuleNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -473,21 +473,4 @@ protected function compileGetSourceContext(Compiler $compiler)
->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.');
}
}
}

0 comments on commit 81ebebb

Please sign in to comment.