lib/AdobeMarketingCloud/HttpClient.php
protected function decodeResponse($response, $options = array())
    {
        if (count($options) == 0) {
            $options = $this->options;
        }

        switch ($options['format'])
        {
            case 'json':
                $json = json_decode($response['response'], TRUE);
                if ($json === null) {
                    $debugPrintout = "";
                    if ($options['debug'] === TRUE) {
                        $debugPrintout = ": \n\n" . print_r($response, TRUE);
                    }

                    throw new Exception("Response is not in JSON format $debugPrintout");
                }

                return $json;

            case 'jsonp':
                throw new \LogicException("format 'jsonp' not yet supported by this library");

            case 'xml':
                return json_decode(json_encode(simplexml_load_string($response['response'])), true);

            case 'xspf':
                throw new \LogicException("format 'xspf' not yet supported by this library");

            case 'raw':
                return $response['response'];
        }

        throw new \LogicException(__CLASS__.' only supports json, json, xml, and xspf formats, '.$options['format'].' given.');
    }
protected function decodeResponse($response, $options = array())
    {
        if (count($options) == 0) {
            $options = $this->options;
        }

        switch ($options['format'])
        {
            case 'json':
                $json = json_decode($response['response'], TRUE);
                if ($json === null) {
                    $debugPrintout = "";
                    if ($options['debug'] === TRUE) {
                        $debugPrintout = ": \n\n" . print_r($response, TRUE);
                    }

                    throw new Exception("Response is not in JSON format $debugPrintout");
                }

                return $json;

            case 'jsonp':
                throw new \LogicException("format 'jsonp' not yet supported by this library");

            case 'xml':
                return json_decode(json_encode(simplexml_load_string($response['response'])), true);

            case 'xspf':
                throw new \LogicException("format 'xspf' not yet supported by this library");

            case 'raw':
                return $response['response'];
        }

        throw new \LogicException(__CLASS__.' only supports json, json, xml, and xspf formats, '.$options['format'].' given.');
    }
Get a JSON response and transform it to a PHP array

@return  array   the response
@throws Exception
@throws \LogicException