From 027d33838f0e5a2785ad4b716ae62d7c2d10d539 Mon Sep 17 00:00:00 2001 From: Angger Pradana Date: Tue, 17 Sep 2024 21:07:20 +0700 Subject: [PATCH] resolve --- src/System/Cache/Storage/FileStorage.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/System/Cache/Storage/FileStorage.php b/src/System/Cache/Storage/FileStorage.php index aa475d3e..4481e836 100644 --- a/src/System/Cache/Storage/FileStorage.php +++ b/src/System/Cache/Storage/FileStorage.php @@ -32,13 +32,11 @@ public function getInfo(string $key): array $data = file_get_contents($filePath); - if ($data === false) { + if (false === $data) { return []; } - $cacheData = unserialize($data); - - return $cacheData; + return unserialize($data); } public function get(string $key, mixed $default = null): mixed @@ -71,7 +69,7 @@ public function set(string $key, mixed $value, int|\DateInterval|null $ttl = nul $filePath = $this->makePath($key); $directory = dirname($filePath); - if (!is_dir($directory)) { + if (false === is_dir($directory)) { mkdir($directory, 0777, true); }