Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
64 | 117 | private static function _detectError() |
|
65 | { |
||
66 | 117 | $errorCode = json_last_error(); |
|
67 | 117 | if ($errorCode === JSON_ERROR_NONE) { |
|
68 | 114 | return; |
|
69 | } |
||
70 | |||
71 | 4 | $message = 'A JSON error occurred'; |
|
72 | 4 | if (function_exists('json_last_error_msg')) { |
|
73 | 4 | $message .= ': ' . json_last_error_msg(); |
|
74 | } |
||
75 | 4 | $message .= ' (' . $errorCode . ')'; |
|
76 | 4 | throw new Exception($message, 90); |
|
77 | } |
||
79 |