@param string $url

@return Collection
340194
private function executeQuery(string $url): AddressCollection
    {
        $content = $this->getUrlContents($url);
        $data = json_decode($content, true);

        if (empty($data) || !isset($data['loc']) || '' === $data['loc']) {
            return new AddressCollection([]);
        }

        $location = explode(',', $data['loc']);

        return new AddressCollection([
            Address::createFromArray([
                'providedBy' => $this->getName(),
                'latitude' => $location[0],
                'longitude' => $location[1],
                'locality' => $data['city'] ?? null,
                'postalCode' => $data['postal'] ?? null,
                'adminLevels' => isset($data['region']) ? [['name' => $data['region'], 'level' => 1]] : [],
                'countryCode' => $data['country'] ?? null,
            ]),
        ]);
    }
475186
public function setUrl($url)
    {
        $url = parse_url($url);

        $this->setHost($url['host']);

        if(isset($url['port']))
        {
            $this->setPort($url['port']);
        }

        return $this;
    }
1017557
private function executeQuery(string $url): AddressCollection
    {
        $content = $this->getUrlContents($url);
        $json = json_decode($content, true);

        // See https://mapzen.com/documentation/search/api-keys-rate-limits/
        if (isset($json['meta'])) {
            switch ($json['meta']['status_code']) {
                case 403:
                    throw new InvalidCredentials('Invalid or missing api key.');
                case 429:
                    throw new QuotaExceeded('Valid request but quota exceeded.');
            }
        }

        if (!isset($json['type']) || 'FeatureCollection' !== $json['type'] || !isset($json['features']) || 0 === count($json['features'])) {
            return new AddressCollection([]);
        }

        $locations = $json['features'];

        if (empty($locations)) {
            return new AddressCollection([]);
        }

        $results = [];
        foreach ($locations as $location) {
            $bounds = [
                'south' => null,
                'west' => null,
                'north' => null,
                'east' => null,
            ];
            if (isset($location['bbox'])) {
                $bounds = [
                    'south' => $location['bbox'][3],
                    'west' => $location['bbox'][2],
                    'north' => $location['bbox'][1],
                    'east' => $location['bbox'][0],
                ];
            }

            $props = $location['properties'];

            $adminLevels = [];
            foreach (['region', 'county', 'locality', 'macroregion', 'country'] as $i => $component) {
                if (isset($props[$component])) {
                    $adminLevels[] = ['name' => $props[$component], 'level' => $i + 1];
                }
            }

            $results[] = Address::createFromArray([
                'providedBy' => $this->getName(),
                'latitude' => $location['geometry']['coordinates'][1],
                'longitude' => $location['geometry']['coordinates'][0],
                'bounds' => $bounds,
                'streetNumber' => isset($props['housenumber']) ? $props['housenumber'] : null,
                'streetName' => isset($props['street']) ? $props['street'] : null,
                'subLocality' => isset($props['neighbourhood']) ? $props['neighbourhood'] : null,
                'locality' => isset($props['locality']) ? $props['locality'] : null,
                'postalCode' => isset($props['postalcode']) ? $props['postalcode'] : null,
                'adminLevels' => $adminLevels,
                'country' => isset($props['country']) ? $props['country'] : null,
                'countryCode' => isset($props['country_a']) ? strtoupper($props['country_a']) : null,
            ]);
        }

        return new AddressCollection($results);
    }
214884
protected function getRequest($url) {
        $Request = new Request();
        $Request->setTransport(Request::TRANSPORT_CURL);
        return $Request->setUrl($url)
            ->setConnectTimeout($this->getConnectTimeout())
            ->setTimeout($this->getRequestTimeout())
            ->setContentTypeCode(Request::CONTENT_TYPE_JSON);
    }
195392
public function get($url)
    {
        if (isset($this->entries[$url])) {
            return $this->entries[$url];
        } else {
            return null;
        }
    }
890547
public static function createFromUrl($url)
    {
        $instance = new static();

        if (self::$generic_file->fetchUrl($url, null, $instance)) {
            return $instance;
        }

        return;
    }
1235776
public function url($url)
    {
        if (parse_url($url, PHP_URL_SCHEME) == '') {
            $url = wei()->request->getUrlFor($url);
        }

        $this->request['url'] = $url;

        return $this;
    }
1135993
protected function doFetch($url)
    {
        foreach ($this->crawlers as $crawler) {
            $data = $crawler->crawl($url);

            if (is_array($data)) {
                $title = isset($data['title']) ? $data['title'] : null;
                $description = isset($data['description']) ? $data['description'] : null;
                $type = isset($data['type']) ? $data['type'] : 'unknown';
                $images = isset($data['images']) ? (array) $data['images'] : array();

                return array(
                    'title'        => $title,
                    'description'  => $description,
                    'type'         => $type,
                    'images'       => $images,
                    'total_images' => count($images)
                );
            }
        }

        return false;
    }
300209
public function setUrl($url)
    {
        if (strpos($url, '/') !== 0) {
            $url = '/' . $url;
        }
        $this->url = $url;
        return $this;
    }
605232
public static function fromUrl($url)
    {
        $elements = parse_url($url);
        $elements['pathinfo'] = isset($elements['path']) ? $elements['path'] : '';

        if (isset($elements['query'])) {
            parse_str($elements['query'], $queryParams);
            $elements['queryParams'] = $queryParams;
        }

        // Remove unwanted keys returned by parse_url() so that we don't have them as properties.
        unset($elements['path'], $elements['query'], $elements['user'], $elements['pass'], $elements['fragment']);

        return new static($elements);
    }
657645
public function setUrl($url)
    {
        // validate url
        if (filter_var($url, FILTER_VALIDATE_URL)) {
            $this->url = $url;
        } else {
            throw new InvalidUrlException('"' . $url . '" is not a valid URL');
        }

        return $this;
    }
669431
public function getExtReference($url)
    {
        $path = parse_url($url, PHP_URL_PATH);
        if ($path === false) {
            throw new \InvalidArgumentException(sprintf('URL %s', $url));
        }

        $id = null;
        $collection = null;

        if (!isset($this->resolvingCache[$path])) {
            foreach ($this->router->getRouteCollection()->all() as $route) {
                list($collection, $id) = $this->getDataFromRoute($route, $path);
                if ($collection !== null && $id !== null) {
                    $this->resolvingCache[$path] = $route;
                    return ExtReference::create($collection, $id);
                }
            }
        } else {
            list($collection, $id) = $this->getDataFromRoute($this->resolvingCache[$path], $path);
            return ExtReference::create($collection, $id);
        }

        throw new \InvalidArgumentException(sprintf('Could not read URL %s', $url));
    }
297413
public static function factory($url)
    {
        static $defaults = array('scheme' => null, 'host' => null, 'path' => null, 'port' => null, 'query' => null,
            'user' => null, 'pass' => null, 'fragment' => null);

        if (false === ($parts = parse_url($url))) {
            throw new InvalidArgumentException('Was unable to parse malformed url: ' . $url);
        }

        $parts += $defaults;

        // Convert the query string into a QueryString object
        if ($parts['query'] || 0 !== strlen($parts['query'])) {
            $parts['query'] = QueryString::fromString($parts['query']);
        }

        return new static($parts['scheme'], $parts['host'], $parts['user'],
            $parts['pass'], $parts['port'], $parts['path'], $parts['query'],
            $parts['fragment']);
    }
397872
public static function fromString($url)
    {
        static $defaults = ['scheme' => null, 'host' => null,
            'path' => null, 'port' => null, 'query' => null,
            'user' => null, 'pass' => null, 'fragment' => null];

        if (false === ($parts = parse_url($url))) {
            throw new \InvalidArgumentException('Unable to parse malformed '
                . 'url: ' . $url);
        }

        $parts += $defaults;

        // Convert the query string into a Query object
        if ($parts['query'] || 0 !== strlen($parts['query'])) {
            $parts['query'] = Query::fromString($parts['query']);
        }

        return new static($parts['scheme'], $parts['host'], $parts['user'],
            $parts['pass'], $parts['port'], $parts['path'], $parts['query'],
            $parts['fragment']);
    }
457084
public function rels(array $urns)
    {
        $rawLinks = [];
        foreach ($this as $i => $link) {
            if (!empty($link->rels)) {
                $match = array_diff($urns, $link->rels);
                if (count($match) != count($urns)) {
                    $rawLinks[] = $this->_links[$i];
                }
            }
        }
        return new CollectionDocJsonLinks($rawLinks, $this->_auth);
    }
204537
public function dir_from_url($url){
    $dir = false;
    foreach ( $this->dirs() as $i => $d ){
      if ( (strpos($url, $i) === 0) &&
        (\strlen($i) > \strlen($dir) )
      ){
        $dir = $i;
        break;
      }
    }
    return $dir;
  }
155749
public function get($url) {
		$archives = $this->archives($url);
		if (count($archives) > 0) {
			// currently just fetching the latest. to do: add ability to get older version
			return [$this->getResponse($url), null];
		} else {
			return $this->archive($url);
		}
	}