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
|
public static function checkLogLevel(string $input): bool
|
||||||
{
|
{
|
||||||
// TODO: Fix this, it's not the proper use of cases()
|
return in_array(strtolower($input), array_map(
|
||||||
if(!in_array(strtolower($input), LogLevel::cases()))
|
fn($case) => $case->value, LogLevel::cases()), true
|
||||||
{
|
);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue