Skip to content

Commit

Permalink
resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
SonyPradana authored Sep 17, 2024
1 parent e030f59 commit 027d338
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/System/Cache/Storage/FileStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 027d338

Please sign in to comment.