Lines 100.00% 2 / 2
Methods 100.00% 2 / 2
Classes 100.00% 1 / 1
Name Lines Methods CRAP
 __construct 100.00% 1 / 1 100.00% 1 / 1 1
 encodeToJson 100.00% 1 / 1 100.00% 1 / 1 1
12final class EncodedStateChange
13{
14    private ?string $json = null;
15
16    public function __construct(public readonly StateChange $change) {}
17
18    /** @throws JsonException|StewartException */
19    public function encodeToJson(WireMapper $mapper): string
20    {
21        return $this->json ??= $mapper->encodeObject($this->change);
22    }
23}