function CheckToStringNode::compile
Overrides Node::compile
1 method overrides CheckToStringNode::compile()
- TwigSimpleCheckToStringNode::compile in core/
lib/ Drupal/ Core/ Template/ TwigSimpleCheckToStringNode.php
File
-
vendor/
twig/ twig/ src/ Node/ CheckToStringNode.php, line 36
Class
- CheckToStringNode
- Checks if casting an expression to __toString() is allowed by the sandbox.
Namespace
Twig\NodeCode
public function compile(Compiler $compiler) : void {
$expr = $this->getNode('expr');
$compiler->raw('$this->sandbox->ensureToStringAllowed(')
->subcompile($expr)
->raw(', ')
->repr($expr->getTemplateLine())
->raw(', $this->source)');
}