| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 46 | public static function decode(string $json, bool $assoc = false, int $depth = 512, int $options = 0) |
||
| 47 | { |
||
| 48 | $decoded = json_decode($json, $assoc, $depth, $options); |
||
| 49 | |||
| 50 | if (json_last_error() !== JSON_ERROR_NONE) { |
||
| 51 | throw new JsonException(sprintf('Unable to decode json. Error was: "%s".', json_last_error_msg())); |
||
| 52 | } |
||
| 53 | |||
| 54 | return $decoded; |
||
| 55 | } |
||
| 57 |