diff --git a/src/Caching/Storages/FileStorage.php b/src/Caching/Storages/FileStorage.php index 48a832e2..472daf0d 100644 --- a/src/Caching/Storages/FileStorage.php +++ b/src/Caching/Storages/FileStorage.php @@ -114,7 +114,7 @@ private function verify(array $meta): bool if (!empty($meta[self::META_ITEMS])) { foreach ($meta[self::META_ITEMS] as $depFile => $time) { $m = $this->readMetaAndLock($depFile, LOCK_SH); - if ($m[self::META_TIME] !== $time || ($m && !$this->verify($m))) { + if (!$m || $m[self::META_TIME] !== $time || !$this->verify($m)) { break 2; } } @@ -160,7 +160,7 @@ public function write(string $key, $data, array $dp): void foreach ($dp[Cache::ITEMS] as $item) { $depFile = $this->getCacheFile($item); $m = $this->readMetaAndLock($depFile, LOCK_SH); - $meta[self::META_ITEMS][$depFile] = $m[self::META_TIME]; // may be null + $meta[self::META_ITEMS][$depFile] = $m[self::META_TIME] ?? null; // may be null unset($m); } }