From be8eb6394468b57bb7a4573a98afd77a6bb8e907 Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Sat, 20 Apr 2019 13:55:55 -0300 Subject: [PATCH] Use Null Coalesce Operator (#2466) --- system/src/Grav/Framework/Cache/Adapter/MemoryCache.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/system/src/Grav/Framework/Cache/Adapter/MemoryCache.php b/system/src/Grav/Framework/Cache/Adapter/MemoryCache.php index 2d0fe40bd..ea502dc4c 100644 --- a/system/src/Grav/Framework/Cache/Adapter/MemoryCache.php +++ b/system/src/Grav/Framework/Cache/Adapter/MemoryCache.php @@ -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)