30 if (func_num_args() == 0) {
44 'error' => Formatter::formatExceptionAsDataArray(
60 return 'application/xml';
70 assert(
'is_array($data) || $node instanceof Traversable');
73 if (is_numeric(
$key)) {
79 $key = preg_replace(
'/[^a-z0-9\-\_\.\:]/i',
'',
$key);
81 if (is_array($value)) {
82 $child = $node->addChild(
$key);
83 self::addDataToNode($child, $value);
85 $value = str_replace(
'&',
'&', print_r($value,
true));
86 $node->addChild(
$key, $value);
101 assert(
'is_array($data) || $node instanceof Traversable');
103 $node = simplexml_load_string(
"<?xml version='1.0' encoding='utf-8'?><root />");
105 return self::addDataToNode($node,
$data)->asXML();
Whoops - php errors for cool kids.
Catches an exception and converts it to an XML response.
const QUIT
The Handler has handled the Throwable in some way, and wishes to quit/stop execution.
Abstract implementation of a Handler.
static addDataToNode(\SimpleXMLElement $node, $data)
addTraceToOutput($returnFrames=null)
static toXml($data)
The main function for converting to an XML document.