mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 20:06:31 +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")
|
->raw(");\n")
|
||||||
;
|
;
|
||||||
} else {
|
} else {
|
||||||
$compiler
|
throw new LogicException('Trait templates can only be constant nodes');
|
||||||
->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")
|
|
||||||
;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user