Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2.032 |
Changes | 0 |
1 | <?php |
||
42 | 50 | public function decode($json) |
|
43 | { |
||
44 | 50 | $data = json_decode($json, $this->assoc, $this->depth, $this->options); |
|
45 | |||
46 | 50 | if (json_last_error() !== JSON_ERROR_NONE) { |
|
47 | throw new JsonDecodingException(sprintf('Invalid JSON: %s', json_last_error_msg())); |
||
48 | } |
||
49 | |||
50 | 50 | return $data; |
|
51 | } |
||
52 | } |
||
53 |