From 237db1c58a9972aa1d89ae24389d44b0fadaa009 Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Thu, 27 Aug 2020 16:15:54 +0200 Subject: [PATCH] Use type-specific comparisons over empty --- MDErrorReporter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MDErrorReporter.php b/MDErrorReporter.php index b080cde..4c920e6 100644 --- a/MDErrorReporter.php +++ b/MDErrorReporter.php @@ -79,7 +79,7 @@ class MDErrorReporter { final private function _formulateDebugMailSection(string $headline, array $toFormat, int $level = 0):string { $msg = ""; - if (!empty($headline)) { + if ($headline !== "") { if ($level === 0) { $msg .= PHP_EOL . "## " . $headline; $msg .= PHP_EOL . "----------------------" . PHP_EOL . PHP_EOL; @@ -147,7 +147,7 @@ class MDErrorReporter { ========================= "; - if (!empty($contextInfo)) { + if ($contextInfo !== []) { $msg .= $this->_formulateDebugMailSection("Context information", $contextInfo); }