From 443e4a94fc00711cb618b446d071b2a027395c88 Mon Sep 17 00:00:00 2001 From: Westin Shafer Date: Sun, 18 Jun 2017 18:49:55 -0600 Subject: [PATCH] Minor code cleanup on Handler/ErrorLogHandler.php (#995) Just some cleanup for readability. --- src/Monolog/Handler/ErrorLogHandler.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Monolog/Handler/ErrorLogHandler.php b/src/Monolog/Handler/ErrorLogHandler.php index b2728781..2c801398 100644 --- a/src/Monolog/Handler/ErrorLogHandler.php +++ b/src/Monolog/Handler/ErrorLogHandler.php @@ -71,13 +71,14 @@ class ErrorLogHandler extends AbstractProcessingHandler */ protected function write(array $record) { - if ($this->expandNewlines) { - $lines = preg_split('{[\r\n]+}', (string) $record['formatted']); - foreach ($lines as $line) { - error_log($line, $this->messageType); - } - } else { + if (!$this->expandNewlines) { error_log((string) $record['formatted'], $this->messageType); + return; + } + + $lines = preg_split('{[\r\n]+}', (string) $record['formatted']); + foreach ($lines as $line) { + error_log($line, $this->messageType); } } }