src/Context/ApiContext.php
protected function getResponseBody() {
        $body = json_decode((string) $this->response->getBody());

        if (json_last_error() !== JSON_ERROR_NONE) {
            throw new InvalidArgumentException('The response body does not contain valid JSON data.');
        } else if (!is_array($body) && !($body instanceof stdClass)) {
            throw new InvalidArgumentException('The response body does not contain a valid JSON array / object.');
        }

        return $body;
    }
protected function getResponseBody() {
        $body = json_decode((string) $this->response->getBody());

        if (json_last_error() !== JSON_ERROR_NONE) {
            throw new InvalidArgumentException('The response body does not contain valid JSON data.');
        } else if (!is_array($body) && !($body instanceof stdClass)) {
            throw new InvalidArgumentException('The response body does not contain a valid JSON array / object.');
        }

        return $body;
    }
protected function getResponseBody ( ) { $ body = json_decode ( ( string ) $ this -> response -> getBody ( ) ) ; if ( json_last_error ( ) !== JSON_ERROR_NONE ) { throw new InvalidArgumentException ( 'The response body does not contain valid JSON data.' ) ; } else if ( ! is_array ( $ body ) && ! ( $ body instanceof stdClass ) ) { throw new InvalidArgumentException ( 'The response body does not contain a valid JSON array / object.' ) ; } return $ body ; }
Get the JSON-encoded array or stdClass from the response body

@throws InvalidArgumentException
@return array|stdClass
Get the JSON - encoded array or stdClass from the response body