*/ class CheckToStringNode extends AbstractExpression { public function __construct(AbstractExpression $expr) { parent::__construct(['expr' => $expr], [], $expr->getTemplateLine(), $expr->getNodeTag()); } public function compile(Compiler $compiler) { $compiler ->raw('$this->sandbox->ensureToStringAllowed(') ->subcompile($this->getNode('expr')) ->raw(')') ; } }