Cmfcmf\OpenWeatherMap::cacheOrFetchResult PHP Метод

cacheOrFetchResult() приватный Метод

Fetches the result or delivers a cached version of the result.
private cacheOrFetchResult ( string $url ) : string
$url string
Результат string
    private function cacheOrFetchResult($url)
    {
        if ($this->cache !== false) {
            /** @var AbstractCache $cache */
            $cache = $this->cache;
            $cache->setSeconds($this->seconds);
            if ($cache->isCached($url)) {
                $this->wasCached = true;
                return $cache->getCached($url);
            }
            $result = $this->fetcher->fetch($url);
            $cache->setCached($url, $result);
        } else {
            $result = $this->fetcher->fetch($url);
        }
        $this->wasCached = false;
        return $result;
    }