Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2.0116 |
Changes | 0 |
1 | <?php |
||
7 | 5 | public static function decode($json, $assoc = false, $depth = 512, $option = 0) |
|
8 | { |
||
9 | 5 | $decodedJson = json_decode($json, $assoc, $depth, $option); |
|
10 | |||
11 | 5 | $jsonLastError = json_last_error(); |
|
12 | 5 | if($jsonLastError != JSON_ERROR_NONE) |
|
13 | 5 | { |
|
14 | 5 | throw new Exceptions\JsonDecodeError(json_last_error_msg()); |
|
15 | } |
||
16 | |||
17 | return $decodedJson; |
||
18 | } |
||
19 | |||
32 |