Lines
100.00%
3 / 3
Methods
100.00%
2 / 2
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| reportProbe | 100.00% | 2 / 2 | 100.00% | 1 / 1 | 3 | ||
| 9 | final readonly class SnapshotProbeReporter implements ProbeReporter | |
| 10 | { | |
| 11 | public function __construct( | |
| 12 | private SnapshotSource $snapshots, | |
| 13 | private ReadinessCheck $readiness, | |
| 14 | ) {} | |
| 15 | ||
| 16 | public function reportProbe(ProbeKind $kind): ProbeReport | |
| 17 | { | |
| 18 | return match ($kind) { | |
| 19 | ProbeKind::Liveness => ProbeReport::alive(), | |
| 20 | ProbeKind::Readiness => ProbeReport::fromVerdict($this->readiness->assessSnapshot($this->snapshots->takeSnapshot())), | |
| 21 | }; | |
| 22 | } | |
| 23 | } |