private function processResponse($response) {
        list($status, $headers, $body) = $response;
        // if empty response just return boolean
        if ($status == 204) {
            return true;
        }
        
        $decoded = json_decode($body, true);
        if ($decoded === null) {
            throw new RestException('Could not decode response body as JSON.', $status);
        }
        if (200 <= $status && $status < 300) {
            return $decoded;
        }

        throw new RestException(
            $decoded['message'],
            $decoded['code'],
            (isset($decoded['errors']) ? $decoded['errors'] : null)
        );
    }
private function processResponse($response) {
        list($status, $headers, $body) = $response;
        // if empty response just return boolean
        if ($status == 204) {
            return true;
        }
        
        $decoded = json_decode($body, true);
        if ($decoded === null) {
            throw new RestException('Could not decode response body as JSON.', $status);
        }
        if (200 <= $status && $status < 300) {
            return $decoded;
        }

        throw new RestException(
            $decoded['message'],
            $decoded['code'],
            (isset($decoded['errors']) ? $decoded['errors'] : null)
        );
    }
private function processResponse ( $ response ) { list ( $ status , $ headers , $ body ) = $ response ; // if empty response just return boolean if ( $ status == 204 ) { return true ; } $ decoded = json_decode ( $ body , true ) ; if ( $ decoded === null ) { throw new RestException ( 'Could not decode response body as JSON.' , $ status ) ; } if ( 200 <= $ status && $ status < 300 ) { return $ decoded ; } throw new RestException ( $ decoded [ 'message' ] , $ decoded [ 'code' ] , ( isset ( $ decoded [ 'errors' ] ) ? $ decoded [ 'errors' ] : null ) ) ; }
Convert the JSON encoded response into a PHP object.

@param array $response JSON encoded server response
@return array
Convert the JSON encoded response into a PHP object .