private function resolveApiUrl($url)
    {
        $client = new Client([
            'defaults' => [
                'timeout' => 5,
            ],
        ]);
        $response = $client->get($url);
        $responseStatusCode = $response->getStatusCode();

        if (404 == $responseStatusCode) {
            throw new EntityNotFoundException();
        }

        if (500 == $responseStatusCode) {
            throw new HttpException('Http exception');
        }

        return $response->json(['object' => false]);
    }
private function resolveApiUrl($url)
    {
        $client = new Client([
            'defaults' => [
                'timeout' => 5,
            ],
        ]);
        $response = $client->get($url);
        $responseStatusCode = $response->getStatusCode();

        if (404 == $responseStatusCode) {
            throw new EntityNotFoundException();
        }

        if (500 == $responseStatusCode) {
            throw new HttpException('Http exception');
        }

        return $response->json(['object' => false]);
    }
private function resolveApiUrl ( $ url ) { $ client = new Client ( [ 'defaults' => [ 'timeout' => 5 , ] , ] ) ; $ response = $ client -> get ( $ url ) ; $ responseStatusCode = $ response -> getStatusCode ( ) ; if ( 404 == $ responseStatusCode ) { throw new EntityNotFoundException ( ) ; } if ( 500 == $ responseStatusCode ) { throw new HttpException ( 'Http exception' ) ; } return $ response -> json ( [ 'object' => false ] ) ; }
Call given url, unpack the response and look for possible api exceptions.

@param string $url Url where to call

@return array Response unpacked

@throws EntityNotFoundException Entity not found
@throws HttpException           Http Exception
Call given url unpack the response and look for possible api exceptions .