Lines
100.00%
4 / 4
Methods
100.00%
1 / 1
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| canEnter | 100.00% | 4 / 4 | 100.00% | 1 / 1 | 4 | ||
| 7 | enum AppLifecyclePhase | |
| 8 | { | |
| 9 | case Starting; | |
| 10 | case Stopping; | |
| 11 | case Closed; | |
| 12 | ||
| 13 | public function canEnter(self $next): bool | |
| 14 | { | |
| 15 | return match ($this) { | |
| 16 | self::Starting => $next === self::Stopping, | |
| 17 | self::Stopping => $next === self::Closed, | |
| 18 | self::Closed => false, | |
| 19 | }; | |
| 20 | } | |
| 21 | } |