mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 19:36:43 +00:00
Remove broken code
Trait templates can only be constant expression nodes, so fixing the broken is not actually needed and it can be removed.
This commit is contained in:
@@ -402,22 +402,7 @@ class Twig_Node_Module extends Twig_Node
|
||||
->raw(");\n")
|
||||
;
|
||||
} else {
|
||||
$compiler
|
||||
->write(sprintf('%s = ', $var))
|
||||
->subcompile($node)
|
||||
->raw(";\n")
|
||||
->write(sprintf('if (!%s', $var))
|
||||
->raw(" instanceof Twig_Template) {\n")
|
||||
->indent()
|
||||
->write(sprintf('%s = $this->loadTemplate(%s')
|
||||
->raw(', ')
|
||||
->repr($compiler->getFilename())
|
||||
->raw(', ')
|
||||
->repr($node->getLine())
|
||||
->raw(");\n", $var, $var))
|
||||
->outdent()
|
||||
->write("}\n")
|
||||
;
|
||||
throw new LogicException('Trait templates can only be constant nodes');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user