You've already forked Atomcms-edit
Initial commit
This commit is contained in:
Executable
+33
@@ -0,0 +1,33 @@
|
||||
<?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 => '🚨',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user