Total Complexity | 4 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 82.35% |
Changes | 0 |
1 | <?php |
||
7 | enum SpacecraftAlertStateEnum: int |
||
8 | { |
||
9 | case ALERT_GREEN = 1; |
||
10 | case ALERT_YELLOW = 2; |
||
11 | case ALERT_RED = 3; |
||
12 | |||
13 | 1 | public function getDescription(): string |
|
14 | { |
||
15 | 1 | return match ($this) { |
|
16 | 1 | self::ALERT_GREEN => "Alarm Grün", |
|
17 | 1 | self::ALERT_YELLOW => "Alarm Gelb", |
|
18 | 1 | self::ALERT_RED => "Alarm Rot" |
|
19 | 1 | }; |
|
20 | } |
||
21 | |||
22 | 8 | public function getEpsUsage(): int |
|
23 | { |
||
24 | 8 | return match ($this) { |
|
25 | 8 | self::ALERT_GREEN => 0, |
|
26 | 8 | self::ALERT_YELLOW => 1, |
|
27 | 8 | self::ALERT_RED => 2 |
|
28 | 8 | }; |
|
29 | } |
||
30 | |||
31 | 1 | public function isAtLeast(SpacecraftAlertStateEnum $minimum): bool |
|
34 | } |
||
35 | |||
36 | public static function getRandomAlertLevel(): SpacecraftAlertStateEnum |
||
42 | } |
||
43 | } |
||
44 |