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 | ||
| createProbeReportWireMapper | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| encodeReport | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| 13 | final readonly class ProbeReportCodec | |
| 14 | { | |
| 15 | public function __construct(private WireMapper $probeReportWireMapper) {} | |
| 16 | ||
| 17 | public static function createProbeReportWireMapper(): WireMapper | |
| 18 | { | |
| 19 | return new WireMapper(new ClassShapeReader(ValueConverterCollection::keyedByHandledClass([]))); | |
| 20 | } | |
| 21 | ||
| 22 | /** @throws JsonException|StewartException */ | |
| 23 | public function encodeReport(ProbeReport $report): string | |
| 24 | { | |
| 25 | return $this->probeReportWireMapper->encodeObject($report); | |
| 26 | } | |
| 27 | } |