Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
zendframework/zendframework#6137 - avoiding elseif where not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Jul 27, 2014
1 parent 95a9cbd commit 16474b7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Formatter/Xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,18 @@ public function format($event)
) {
if ($key == "message") {
$value = $escaper->escapeHtml($value);
} elseif ($key == "extra" && empty($value)) {
}

if ($key == "extra" && empty($value)) {
continue;
} elseif ($key == "extra" && (is_array($value) || $value instanceof Traversable)) {
}

if ($key == "extra" && (is_array($value) || $value instanceof Traversable)) {
$elt->appendChild($this->buildElementTree($dom, $dom->createElement('extra'), $value));

continue;
}

$elt->appendChild(new DOMElement($key, (string) $value));
}
}
Expand Down

0 comments on commit 16474b7

Please sign in to comment.