You've already forked Atomcms-edit
34 lines
680 B
PHP
Executable File
34 lines
680 B
PHP
Executable File
<?php
|
||
|
||
declare(strict_types=1);
|
||
|
||
namespace App\Enums;
|
||
|
||
enum AlertSeverity: string
|
||
{
|
||
case INFO = 'info';
|
||
case WARNING = 'warning';
|
||
case ERROR = 'error';
|
||
case CRITICAL = 'critical';
|
||
|
||
public function getColor(): string
|
||
{
|
||
return match ($this) {
|
||
self::INFO => 'blue',
|
||
self::WARNING => 'yellow',
|
||
self::ERROR => 'orange',
|
||
self::CRITICAL => 'red',
|
||
};
|
||
}
|
||
|
||
public function getEmoji(): string
|
||
{
|
||
return match ($this) {
|
||
self::INFO => 'ℹ️',
|
||
self::WARNING => '⚠️',
|
||
self::ERROR => '❌',
|
||
self::CRITICAL => '🚨',
|
||
};
|
||
}
|
||
}
|