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
12final readonly class WorkerAppsFragment implements JsonFragment
13{
14    private function __construct(public WorkerAppCollection $collection) {}
15
16    public static function fromCollection(WorkerAppCollection $apps): self
17    {
18        return new self($apps);
19    }
20
21    public static function fromDecodedValue(mixed $value, string $path, WireMapper $mapper): static
22    {
23        return new self(WorkerAppCollection::fromList($mapper->decodeObjectList(WorkerApp::class, $value, $path)));
24    }
25
26    public function encodeToJson(WireMapper $mapper): string
27    {
28        return $mapper->encodeObjectList($this->collection->listValues());
29    }
30}