/** * @param NodeInterface $node * @param RenderingContextInterface $renderingContext * @param boolean $cast * @return mixed */ protected function evaluateChildNode(NodeInterface $node, RenderingContextInterface $renderingContext, $cast) { $output = $node->evaluate($renderingContext); if ($cast && is_object($output)) { if (!method_exists($output, '__toString')) { throw new Parser\Exception('Cannot cast object of type "' . get_class($output) . '" to string.', 1273753083); } $output = (string) $output; } return $output; }
/** * Return the value associated to the syntax tree. * * @param RenderingContextInterface $renderingContext * @return number the value stored in this node/subtree. */ public function evaluate(RenderingContextInterface $renderingContext) { return htmlspecialchars($this->node->evaluate($renderingContext), ENT_QUOTES); }