Use Null Coalesce Operator (#2466)

This commit is contained in:
Gabriel Caruso
2019-04-20 13:55:55 -03:00
committed by Andy Miller
parent 9342981d8c
commit be8eb63944

View File

@@ -27,11 +27,7 @@ class MemoryCache extends AbstractCache
public function doGet($key, $miss)
{
if (!array_key_exists($key, $this->cache)) {
return $miss;
}
return $this->cache[$key];
return $this->cache[$key] ?? $miss;
}
public function doSet($key, $value, $ttl)