private static function error($id, $code, $message, $data = null)
    {
        $error = array(
            'code' => $code,
            'message' => $message
        );

        if ($data !== null) {
            $error['data'] = $data;
        }

        return array(
            'jsonrpc' => self::VERSION,
            'id' => $id,
            'error' => $error
        );
    }
private static function error($id, $code, $message, $data = null)
    {
        $error = array(
            'code' => $code,
            'message' => $message
        );

        if ($data !== null) {
            $error['data'] = $data;
        }

        return array(
            'jsonrpc' => self::VERSION,
            'id' => $id,
            'error' => $error
        );
    }
private static function error ( $ id , $ code , $ message , $ data = null ) { $ error = array ( 'code' => $ code , 'message' => $ message ) ; if ( $ data !== null ) { $ error [ 'data' ] = $ data ; } return array ( 'jsonrpc' => self :: VERSION , 'id' => $ id , 'error' => $ error ) ; }
Returns a properly-formatted error object.

@param mixed $id
Client-supplied value that allows the client to associate the server response
with the original query.

@param int $code
Integer value representing the general type of error encountered.

@param string $message
Concise description of the error (ideally a single sentence).

@param null|boolean|integer|float|string|array $data
An optional primitive value that contains additional information about
the error.

@return array
Returns an error object.
Returns a properly - formatted error object .