Had to roll back previous MessageLevel changes
Keep everything lower case as is any upper case check have to go through fromName, this will convert to lowercase anyway
This commit is contained in:
1 parent
bd4f674f0f
commit
259f9cebf3
2 files changed
+10
-8
No files matched your search
@@ -40,6 +40,8 @@ print "Log ERROR: " . $log->prAr($em->getFlagLogError()) . "<br>";
|
|||||||
print "FN: " . ml::fromName('Affe')->name . "<br>";
|
print "FN: " . ml::fromName('Affe')->name . "<br>";
|
||||||
print "NU: " . ml::fromValue(100)->name . "<br>";
|
print "NU: " . ml::fromValue(100)->name . "<br>";
|
||||||
print "NU: " . ml::fromValue(1000)->name . "<br>";
|
print "NU: " . ml::fromValue(1000)->name . "<br>";
|
||||||
|
print "OK.: " . ml::ok->name . "<br>";
|
||||||
|
print "OK^: " . ml::fromName('OK')->name . "<br>";
|
||||||
|
|
||||||
$em->setErrorMsg('123', 'error', 'msg this is bad, auto logged if debug');
|
$em->setErrorMsg('123', 'error', 'msg this is bad, auto logged if debug');
|
||||||
$em->setErrorMsg('123', 'error', 'msg this is bad, auto logged if debug', 'target-id', 'other-style');
|
$em->setErrorMsg('123', 'error', 'msg this is bad, auto logged if debug', 'target-id', 'other-style');
|
||||||
|
|||||||
@@ -31,14 +31,14 @@ enum MessageLevel: int
|
|||||||
public static function fromName(string $name): self
|
public static function fromName(string $name): self
|
||||||
{
|
{
|
||||||
return match (strtolower($name)) {
|
return match (strtolower($name)) {
|
||||||
'ok', 'OK' => self::ok,
|
'ok' => self::ok,
|
||||||
'success', 'SUCCESS' => self::success,
|
'success' => self::success,
|
||||||
'info', 'INFO' => self::info,
|
'info' => self::info,
|
||||||
'notice', 'NOTICE' => self::notice,
|
'notice' => self::notice,
|
||||||
'warn', 'warning', 'WARN', 'WARNING' => self::warn,
|
'warn', 'warning' => self::warn,
|
||||||
'error', 'ERROR' => self::error,
|
'error' => self::error,
|
||||||
'abort', 'ABORT' => self::abort,
|
'abort' => self::abort,
|
||||||
'crash', 'CRASH' => self::crash,
|
'crash' => self::crash,
|
||||||
default => self::unknown,
|
default => self::unknown,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user