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