Lines
100.00%
3 / 3
Methods
100.00%
3 / 3
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| alive | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| fromVerdict | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 2 | ||
| 9 | final readonly class ProbeReport | |
| 10 | { | |
| 11 | /** @param list<string> $reasons */ | |
| 12 | public function __construct( | |
| 13 | public ProbeStatus $status, | |
| 14 | #[ListOf('string')] | |
| 15 | public array $reasons, | |
| 16 | ) {} | |
| 17 | ||
| 18 | public static function alive(): self | |
| 19 | { | |
| 20 | return new self(ProbeStatus::Alive, []); | |
| 21 | } | |
| 22 | ||
| 23 | public static function fromVerdict(ReadinessVerdict $verdict): self | |
| 24 | { | |
| 25 | return new self($verdict->isReady() ? ProbeStatus::Ready : ProbeStatus::NotReady, $verdict->unreadyReasons); | |
| 26 | } | |
| 27 | } |