Merge YieldingTemplate and Template

This commit is contained in:
Fabien Potencier
2024-02-05 15:35:02 +01:00
parent b3eeb41861
commit c129040d46
6 changed files with 164 additions and 380 deletions
+2 -2
View File
@@ -151,14 +151,14 @@ final class ModuleNode extends Node
->write("use Twig\Sandbox\SecurityNotAllowedFilterError;\n")
->write("use Twig\Sandbox\SecurityNotAllowedFunctionError;\n")
->write("use Twig\Source;\n")
->write("use Twig\YieldingTemplate;\n\n")
->write("use Twig\Template;\n\n")
;
}
$compiler
// if the template name contains */, add a blank to avoid a PHP parse error
->write('/* '.str_replace('*/', '* /', $this->getSourceContext()->getName())." */\n")
->write('class '.$compiler->getEnvironment()->getTemplateClass($this->getSourceContext()->getName(), $this->getAttribute('index')))
->raw(" extends YieldingTemplate\n")
->raw(" extends Template\n")
->write("{\n")
->indent()
->write("private Source \$source;\n")