Lines
100.00%
4 / 4
Methods
100.00%
4 / 4
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| fromCollection | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| fromDecodedValue | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| encodeToJson | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| 13 | final readonly class AppIdsFragment implements JsonFragment | |
| 14 | { | |
| 15 | private function __construct(public AppIdCollection $collection) {} | |
| 16 | ||
| 17 | public static function fromCollection(AppIdCollection $appIds): self | |
| 18 | { | |
| 19 | return new self($appIds); | |
| 20 | } | |
| 21 | ||
| 22 | public static function fromDecodedValue(mixed $value, string $path, WireMapper $mapper): static | |
| 23 | { | |
| 24 | return new self(AppIdCollection::fromList($mapper->decodeObjectList(AppId::class, $value, $path))); | |
| 25 | } | |
| 26 | ||
| 27 | public function encodeToJson(WireMapper $mapper): string | |
| 28 | { | |
| 29 | return JsonEncoder::encodeToJson($this->collection->toStrings()); | |
| 30 | } | |
| 31 | } |