chore: complete update
This commit is contained in:
45
src/Framework/Exception/SecurityLogLevel.php
Normal file
45
src/Framework/Exception/SecurityLogLevel.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Exception;
|
||||
|
||||
/**
|
||||
* Security-spezifische Log-Level nach OWASP-Standard
|
||||
*/
|
||||
enum SecurityLogLevel: string
|
||||
{
|
||||
case DEBUG = 'DEBUG';
|
||||
case INFO = 'INFO';
|
||||
case WARN = 'WARN';
|
||||
case ERROR = 'ERROR';
|
||||
case FATAL = 'FATAL';
|
||||
|
||||
/**
|
||||
* Konvertiert zu Standard-PSR-Log-Level
|
||||
*/
|
||||
public function toPsrLevel(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::DEBUG => 'debug',
|
||||
self::INFO => 'info',
|
||||
self::WARN => 'warning',
|
||||
self::ERROR => 'error',
|
||||
self::FATAL => 'critical',
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Numerischer Wert für Vergleiche
|
||||
*/
|
||||
public function getNumericValue(): int
|
||||
{
|
||||
return match ($this) {
|
||||
self::DEBUG => 100,
|
||||
self::INFO => 200,
|
||||
self::WARN => 300,
|
||||
self::ERROR => 400,
|
||||
self::FATAL => 500,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user