Skip to content

Commit

Permalink
zendframework#6137 - simplified ternary, alignment, spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius authored and dima committed Nov 27, 2014
1 parent 46e5b24 commit cadf164
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions library/Zend/Log/Formatter/Xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ protected function buildElementTree(DOMDocument $doc, DOMElement $rootElement, $
if (is_array($value) || $value instanceof Traversable) {
// current value is an array, start recursion
$rootElement->appendChild($this->buildElementTree($doc, $doc->createElement($key), $value));

continue;
}

Expand All @@ -237,12 +238,12 @@ protected function buildElementTree(DOMDocument $doc, DOMElement $rootElement, $

if (is_numeric($key)) {
// xml does not allow numeric values, try to switch the value and the key
$key = (string)$value;
$key = (string) $value;
$value = null;
}

try {
$rootElement->appendChild(new DOMElement($key, (!empty($value)) ? (string) $value : null));
$rootElement->appendChild(new DOMElement($key, empty($value) ? null : (string) $value));
} catch (\DOMException $e) {
// the input name is not valid, go one.
continue;
Expand Down

0 comments on commit cadf164

Please sign in to comment.