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