Refactor checkLogLevel to correctly utilize LogLevel cases
This commit is contained in:
parent
dfa6b50299
commit
aa65dd73cf
1 changed files with 3 additions and 7 deletions
|
@ -228,13 +228,9 @@ namespace ncc\Utilities;
|
|||
*/
|
||||
public static function checkLogLevel(string $input): bool
|
||||
{
|
||||
// TODO: Fix this, it's not the proper use of cases()
|
||||
if(!in_array(strtolower($input), LogLevel::cases()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return in_array(strtolower($input), array_map(
|
||||
fn($case) => $case->value, LogLevel::cases()), true
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue