src/Communibase/Connector.php
private function getLastJsonError()
    {
        static $messages = [
            JSON_ERROR_DEPTH => 'Maximum stack depth exceeded',
            JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch',
            JSON_ERROR_CTRL_CHAR => 'Unexpected control character found',
            JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON',
            JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded',
        ];
        $jsonLastError = json_last_error();

        return array_key_exists($jsonLastError, $messages) ? $messages[$jsonLastError] : 'Empty response received';
    }
private function getLastJsonError()
    {
        static $messages = [
            JSON_ERROR_DEPTH => 'Maximum stack depth exceeded',
            JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch',
            JSON_ERROR_CTRL_CHAR => 'Unexpected control character found',
            JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON',
            JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded',
        ];
        $jsonLastError = json_last_error();

        return array_key_exists($jsonLastError, $messages) ? $messages[$jsonLastError] : 'Empty response received';
    }
private function getLastJsonError ( ) { static $ messages = [ JSON_ERROR_DEPTH => 'Maximum stack depth exceeded' , JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch' , JSON_ERROR_CTRL_CHAR => 'Unexpected control character found' , JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON' , JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded' , ] ; $ jsonLastError = json_last_error ( ) ; return array_key_exists ( $ jsonLastError , $ messages ) ? $ messages [ $ jsonLastError ] : 'Empty response received' ; }
Error message based on the most recent JSON error.

@see http://nl1.php.net/manual/en/function.json-last-error.php

@return string
Error message based on the most recent JSON error .