Skip to content
Snippets Groups Projects
Unverified Commit a6760560 authored by Roeland Jago Douma's avatar Roeland Jago Douma
Browse files

Do not check existance before fetch

parent 07b6e234
No related branches found
No related tags found
No related merge requests found
...@@ -169,24 +169,17 @@ abstract class Proxy { ...@@ -169,24 +169,17 @@ abstract class Proxy {
* @return mixed|null * @return mixed|null
*/ */
public function getFromCache($key) { public function getFromCache($key) {
if(is_null($this->cache) || !$this->isCached($key)) { if($this->cache === null) {
return null; return null;
} }
$key = $this->getCacheKey($key);
return json_decode(base64_decode($this->cache->get($key)));
}
/**
* @param string $key
* @return bool
*/
public function isCached($key) {
if(is_null($this->cache)) {
return false;
}
$key = $this->getCacheKey($key); $key = $this->getCacheKey($key);
return $this->cache->hasKey($key); $value = $this->cache->get($key);
if ($value === null) {
return null;
}
return json_decode(base64_decode($value));
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment