Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
38 | public function json(): array |
||
39 | { |
||
40 | if (!isset($this->json)) { |
||
41 | $json = json_decode( |
||
42 | $this->request()->getContent(), |
||
43 | true, // associative array |
||
44 | 512, // depth |
||
45 | JSON_UNESCAPED_SLASHES |
||
46 | ); |
||
47 | |||
48 | if (JSON_ERROR_NONE !== json_last_error()) { |
||
49 | throw new JsonApiException(new MalformedRequest()); |
||
50 | } |
||
51 | |||
52 | $this->json = $json; |
||
53 | } |
||
54 | |||
55 | return $this->json; |
||
56 | } |
||
57 | |||
73 |