From 19dab07c14bd4007622b4bc8a00cc789477e3aaa Mon Sep 17 00:00:00 2001 From: Mahmoudzadeh Date: Sun, 4 Feb 2024 05:13:57 +0330 Subject: [PATCH] refactor: using ternary operator (reason: more readability) --- src/Loggers/DefaultLogger.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Loggers/DefaultLogger.php b/src/Loggers/DefaultLogger.php index d4118f0d1..59c82a150 100644 --- a/src/Loggers/DefaultLogger.php +++ b/src/Loggers/DefaultLogger.php @@ -22,11 +22,7 @@ public function log($level, $message, array $context = []): void $message = $message->getMessage(); } - if (in_array($level, [LogLevel::NOTICE, LogLevel::INFO])) { - $error_level = E_USER_NOTICE; - } else { - $error_level = E_USER_WARNING; - } + $error_level = in_array($level, [LogLevel::NOTICE, LogLevel::INFO]) ? E_USER_NOTICE : E_USER_WARNING; trigger_error($message, $error_level); }