Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2.3149 |
Changes | 0 |
1 | <?php |
||
29 | 1 | public function __invoke(string $json): GetContractClientsResponse |
|
30 | { |
||
31 | 1 | json_decode($json, true); |
|
32 | |||
33 | 1 | if (json_last_error() !== JSON_ERROR_NONE) { |
|
34 | 1 | throw new InvalidArgumentException('Invalid or malformed JSON'); |
|
35 | } |
||
36 | |||
37 | $serializer = (new SerializerFactory())(); |
||
38 | |||
39 | /** @var GetContractClientsResponse $response */ |
||
40 | $response = $serializer->deserialize($json, GetContractClientsResponse::class, 'json'); |
||
41 | |||
42 | return $response; |
||
43 | } |
||
45 |