From 2be9c895c19ee3ce6b3ff5954c501b4e3c820c40 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Mon, 28 Jul 2014 01:22:20 +0200 Subject: [PATCH] #6137 - minor cleanups, removing useless `else` block --- library/Zend/Log/Formatter/Xml.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/library/Zend/Log/Formatter/Xml.php b/library/Zend/Log/Formatter/Xml.php index c56b51c4634..c8991407256 100644 --- a/library/Zend/Log/Formatter/Xml.php +++ b/library/Zend/Log/Formatter/Xml.php @@ -160,10 +160,11 @@ public function format($event) $event['timestamp'] = $event['timestamp']->format($this->getDateTimeFormat()); } - if ($this->elementMap === null) { - $dataToInsert = $event; - } else { + $dataToInsert = $event; + + if (null !== $this->elementMap) { $dataToInsert = array(); + foreach ($this->elementMap as $elementName => $fieldKey) { $dataToInsert[$elementName] = $event[$fieldKey]; }