| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3.0261 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 41 | 7 | public function deserialize(string $data): array |
|
| 42 | { |
||
| 43 | try { |
||
| 44 | 7 | $res = $this->encoder->decode($data); |
|
| 45 | 1 | } catch (\Exception $e) { |
|
| 46 | 1 | throw new HttpBadRequestException('Bad request, can not json-decode input data'); |
|
| 47 | } |
||
| 48 | 6 | if (!is_array($res)) { |
|
| 49 | throw new HttpBadRequestException('Bad request, can not json-decode input data'); |
||
| 50 | } |
||
| 51 | 6 | return $res; |
|
| 52 | } |
||
| 62 |