Skip to content

Commit

Permalink
help type detection
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangut committed Dec 9, 2023
1 parent 90ed33f commit fa7087d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Whoops/Renderer/XmlRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ protected function addDataNodes(SimpleXMLElement $node, array $data, string $nod
$key = preg_replace('/[^a-z0-9\-_.:]/i', '_', $key);

if (\is_array($value)) {
$this->addDataNodes($node->addChild($key), $value, $key);
/** @var SimpleXMLElement $childNode */
$childNode = $node->addChild($key);
$this->addDataNodes($childNode, $value, $key);
} else {
if (\is_object($value)) {
$value = $value::class;
Expand All @@ -98,8 +100,10 @@ protected function addDataNodes(SimpleXMLElement $node, array $data, string $nod
$value = str_replace('&', '&', print_r($value, true));

if ($key === 'message') {
/** @var SimpleXMLElement $childNode */
$childNode = $node->addChild($key);
/** @var DOMElement $child */
$child = dom_import_simplexml($node->addChild($key));
$child = dom_import_simplexml($childNode);
/** @var DOMDocument $document */
$document = $child->ownerDocument;

Expand Down

0 comments on commit fa7087d

Please sign in to comment.