From 0b2889bb8839d096ffdcf7e65d485d0a79efd52c Mon Sep 17 00:00:00 2001 From: artyom-jaksov-tl Date: Thu, 17 Oct 2024 17:34:15 +0200 Subject: [PATCH] Update Service/Cache/Psr16CacheAdapter.php Co-authored-by: Stefan Danaita --- Service/Cache/Psr16CacheAdapter.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Service/Cache/Psr16CacheAdapter.php b/Service/Cache/Psr16CacheAdapter.php index f86f01b..e52d5d9 100644 --- a/Service/Cache/Psr16CacheAdapter.php +++ b/Service/Cache/Psr16CacheAdapter.php @@ -22,13 +22,11 @@ public function get(string $key, mixed $default = null): mixed { $item = $this->cacheFrontend->load($key); - if ($item !== false) { - $item = unserialize($item); - } else { - $item = $default; + if ($item === false) { + return $default; } - return $item; + return unserialize($item); } /**