public function loadResource(string $url, array $parameters): array
    {
        $signature = $this->createSignature($url, $parameters);
        if ($this->cache->has($signature)) {
            return $this->cache->get($signature);
        }

        $parameters['format'] = 'json';
        $parameters['api_key'] = $this->config->getApiKey();
        $url = $this->config->getApiEndpoint().$this->buildQueryUrl($url, $parameters);

        $response = $this->guzzle->request('GET', $url);
        $body = $this->processResponse($response);

        $this->cache->set($signature, $body['results']);

        return $body['results'];
    }
public function loadResource(string $url, array $parameters): array
    {
        $signature = $this->createSignature($url, $parameters);
        if ($this->cache->has($signature)) {
            return $this->cache->get($signature);
        }

        $parameters['format'] = 'json';
        $parameters['api_key'] = $this->config->getApiKey();
        $url = $this->config->getApiEndpoint().$this->buildQueryUrl($url, $parameters);

        $response = $this->guzzle->request('GET', $url);
        $body = $this->processResponse($response);

        $this->cache->set($signature, $body['results']);

        return $body['results'];
    }
public function loadResource ( string $ url , array $ parameters ) : array { $ signature = $ this -> createSignature ( $ url , $ parameters ) ; if ( $ this -> cache -> has ( $ signature ) ) { return $ this -> cache -> get ( $ signature ) ; } $ parameters [ 'format' ] = 'json' ; $ parameters [ 'api_key' ] = $ this -> config -> getApiKey ( ) ; $ url = $ this -> config -> getApiEndpoint ( ) . $ this -> buildQueryUrl ( $ url , $ parameters ) ; $ response = $ this -> guzzle -> request ( 'GET' , $ url ) ; $ body = $ this -> processResponse ( $ response ) ; $ this -> cache -> set ( $ signature , $ body [ 'results' ] ) ; return $ body [ 'results' ] ; }
Loads a HTTP resource.

@param string $url
@param array  $parameters

@return array
Loads a HTTP resource .