Skip to content

Commit

Permalink
refactor: using ternary operator (reason: more readability)
Browse files Browse the repository at this point in the history
  • Loading branch information
saMahmoudzadeh committed Feb 4, 2024
1 parent 081edfa commit 19dab07
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Loggers/DefaultLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 19dab07

Please sign in to comment.