Total Complexity | 4 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 47.06% |
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 | public function getDescription(): string |
||
19 | }; |
||
20 | } |
||
21 | |||
22 | 7 | public function getEpsUsage(): int |
|
23 | { |
||
24 | 7 | return match ($this) { |
|
25 | 7 | self::ALERT_GREEN => 0, |
|
26 | 4 | self::ALERT_YELLOW => 1, |
|
27 | 7 | self::ALERT_RED => 2 |
|
28 | 7 | }; |
|
29 | } |
||
30 | |||
31 | 1 | public function isAtLeast(SpacecraftAlertStateEnum $minimum): bool |
|
34 | } |
||
35 | |||
36 | public static function getRandomAlertLevel(): SpacecraftAlertStateEnum |
||
44 |