| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | protected function getAndValidateJson(Request $request): array |
||
| 20 | { |
||
| 21 | $content = $request->getContent(); |
||
| 22 | |||
| 23 | if (empty($content)) { |
||
| 24 | throw new ScimException('No content'); |
||
| 25 | } |
||
| 26 | |||
| 27 | $data = json_decode($content, true); |
||
| 28 | |||
| 29 | if (JSON_ERROR_NONE !== json_last_error()) { |
||
| 30 | throw new ScimException('Invalid JSON: '.json_last_error_msg()); |
||
| 31 | } |
||
| 32 | |||
| 33 | return $data; |
||
| 34 | } |
||
| 36 |