cache)) { return; } $key = $this->getFullCacheKey(); if (is_null($key)) { return; } $cacheItem = $this->cache->getItem($key); return $cacheItem->get(); } /** * Saves the value in the cache when that is available. */ private function setCachedValue($v) { if (is_null($this->cache)) { return; } $key = $this->getFullCacheKey(); if (is_null($key)) { return; } $cacheItem = $this->cache->getItem($key); $cacheItem->set($v); $cacheItem->expiresAfter($this->cacheConfig['lifetime']); return $this->cache->save($cacheItem); } private function getFullCacheKey() { if (isset($this->fetcher)) { $fetcherKey = $this->fetcher->getCacheKey(); } else { $fetcherKey = $this->getCacheKey(); } if (is_null($fetcherKey)) { return; } $key = $this->cacheConfig['prefix'] . $fetcherKey; // ensure we do not have illegal characters return str_replace(['{', '}', '(', ')', '/', '\\', '@', ':'], '-', $key); } }