Lines
100.00%
3 / 3
Functions and Methods
100.00%
3 / 3
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ReadinessVerdict | 100.00% | 3 / 3 | 100.00% | 3 / 3 | 4 | 100.00% | 1 / 1 | |||
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| isReady | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| describeVerdict | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 2 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Runtime\Health; | |
| 6 | ||
| 7 | final readonly class ReadinessVerdict | |
| 8 | { | |
| 9 | /** @param list<string> $unreadyReasons */ | |
| 10 | public function __construct(public array $unreadyReasons) {} | |
| 11 | ||
| 12 | public function isReady(): bool | |
| 13 | { | |
| 14 | return $this->unreadyReasons === []; | |
| 15 | } | |
| 16 | ||
| 17 | public function describeVerdict(): string | |
| 18 | { | |
| 19 | return $this->isReady() ? 'ready' : 'not ready: ' . implode('; ', $this->unreadyReasons); | |
| 20 | } | |
| 21 | } |