| Conditions | 3 |
| Paths | 4 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | public function json($key = null, $default = null) |
||
| 29 | { |
||
| 30 | if (!isset($this->json)) { |
||
| 31 | $this->json = new ParameterBag((array)json_decode($this->getContent(), true)); |
||
|
|
|||
| 32 | } |
||
| 33 | |||
| 34 | if (is_null($key)) { |
||
| 35 | return $this->json; |
||
| 36 | } |
||
| 37 | |||
| 38 | return data_get($this->json->all(), $key, $default); |
||
| 39 | } |
||
| 41 |