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