src/V2/ApiHandler.php
protected function getResponseAsJson( ResponseInterface $response ) {
        if( $response->hasHeader('Content-Type') ) {
            $typeHeader = $response->getHeader('Content-Type');
            $contentType = array_shift($typeHeader);

            if( stripos( $contentType, 'application/json' ) === 0 ) {
                return json_decode($response->getBody(), false);
            }
        }

        return null;
    }
protected function getResponseAsJson( ResponseInterface $response ) {
        if( $response->hasHeader('Content-Type') ) {
            $typeHeader = $response->getHeader('Content-Type');
            $contentType = array_shift($typeHeader);

            if( stripos( $contentType, 'application/json' ) === 0 ) {
                return json_decode($response->getBody(), false);
            }
        }

        return null;
    }
protected function getResponseAsJson ( ResponseInterface $ response ) { if ( $ response -> hasHeader ( 'Content-Type' ) ) { $ typeHeader = $ response -> getHeader ( 'Content-Type' ) ; $ contentType = array_shift ( $ typeHeader ) ; if ( stripos ( $ contentType , 'application/json' ) === 0 ) { return json_decode ( $ response -> getBody ( ) , false ) ; } } return null ; }
Returns the json object if the response contains valid json, otherwise null.

@param ResponseInterface $response
@return mixed|null
Returns the json object if the response contains valid json otherwise null .