Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
68 | public static function jsonDeserialize(string $json): self |
||
69 | { |
||
70 | $data = JSON::decode($json); |
||
71 | |||
72 | if (empty($data['path'])) { |
||
73 | throw new LogicException('The message does not contain "path" but it is required.'); |
||
74 | } |
||
75 | |||
76 | if (empty($data['uris'])) { |
||
77 | throw new LogicException('The message uris must not be empty array.'); |
||
78 | } |
||
79 | |||
80 | return new static($data['path'], $data['uris']); |
||
81 | } |
||
82 | } |
||
83 |