protected function parseResponse(Response $response)
    {
        $contentType = explode(';', $response->getHeader('content-type'))[0];

        switch ($contentType) {
            case 'application/json':
            case 'application/vnd.api+json':
                return $response->json();

            case 'application/xml':
                return $response->xml();
        }

        throw new RuntimeException("Unsupported returned content-type [$contentType]");
    }
protected function parseResponse(Response $response)
    {
        $contentType = explode(';', $response->getHeader('content-type'))[0];

        switch ($contentType) {
            case 'application/json':
            case 'application/vnd.api+json':
                return $response->json();

            case 'application/xml':
                return $response->xml();
        }

        throw new RuntimeException("Unsupported returned content-type [$contentType]");
    }
protected function parseResponse ( Response $ response ) { $ contentType = explode ( ';' , $ response -> getHeader ( 'content-type' ) ) [ 0 ] ; switch ( $ contentType ) { case 'application/json' : case 'application/vnd.api+json' : return $ response -> json ( ) ; case 'application/xml' : return $ response -> xml ( ) ; } throw new RuntimeException ( "Unsupported returned content-type [$contentType]" ) ; }
Parse the returned response.

@param  \GuzzleHttp\Message\Response  $response
@return array

@throws RuntimeException
Parse the returned response .