Merge pull request #13135 from nextcloud/caching-docs-fix

Fix call on null errors in cache docs code blocks
This commit is contained in:
Christoph Wurst
2025-05-19 07:44:24 +02:00
committed by GitHub

View File

@@ -121,7 +121,7 @@ A local cache instance can be acquired through the ``\OCP\ICacheFactory`` servic
public function getPicture(string $url): void {
$cache = $this->cacheFactory->createLocal('my-app-pictures');
$cachedPicture = $this->cache->get($url);
$cachedPicture = $cache->get($url);
if ($cachedPicture !== null) {
return $cachedPicture;
}
@@ -157,7 +157,7 @@ A distributed cache instance can be acquired through the ``\OCP\ICacheFactory``
public function getPicture(string $url): void {
$cache = $this->cacheFactory->createDistributed('my-app-pictures');
$cachedPicture = $this->cache->get($url);
$cachedPicture = $cache->get($url);
if ($cachedPicture !== null) {
return $cachedPicture;
}