| Conditions | 4 |
| Paths | 7 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 37 | private function parse(string $body): array |
||
| 38 | { |
||
| 39 | try { |
||
| 40 | $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); |
||
| 41 | return is_array($result) ? $result : []; |
||
| 42 | } catch (\JsonException $e) { |
||
| 43 | if ($this->throwException) { |
||
| 44 | throw new \InvalidArgumentException('Invalid JSON data in request body: ' . $e->getMessage()); |
||
| 45 | } |
||
| 46 | return []; |
||
| 47 | } |
||
| 50 |