Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
59 | public static function jsonDeserialize(string $json): self |
||
60 | { |
||
61 | $data = JSON::decode($json); |
||
62 | |||
63 | if (empty($data['path'])) { |
||
64 | throw new LogicException('The message does not contain "path" but it is required.'); |
||
65 | } |
||
66 | |||
67 | if (empty($data['uris'])) { |
||
68 | throw new LogicException('The message uris must not be empty array.'); |
||
69 | } |
||
70 | |||
71 | return new static($data['path'], $data['uris']); |
||
72 | } |
||
73 | } |
||
74 |