Lines
0.00%
0 / 3
Functions and Methods
0.00%
0 / 1
Classes and Traits
0.00%
0 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| BrokerError | 0.00% | 0 / 3 | 0.00% | 0 / 1 | 12 | 0.00% | 0 / 1 | |||
| messageTemplate | 0.00% | 0 / 3 | 0.00% | 0 / 1 | 12 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Runtime\Exception; | |
| 6 | ||
| 7 | use Stewart\Contracts\Exception\ExceptionReason; | |
| 8 | ||
| 9 | enum BrokerError: string implements ExceptionReason | |
| 10 | { | |
| 11 | case NoWorkersStarted = 'no_workers_started'; | |
| 12 | case WorkerSpawnTimedOut = 'worker_spawn_timed_out'; | |
| 13 | ||
| 14 | public function messageTemplate(): string | |
| 15 | { | |
| 16 | return match ($this) { | |
| 17 | self::NoWorkersStarted => 'None of {workers} workers could be started.', | |
| 18 | self::WorkerSpawnTimedOut => 'Worker {worker} did not connect within {timeout}.', | |
| 19 | }; | |
| 20 | } | |
| 21 | } |