Skip to content

Commit 9bc747e

Browse files
committed
PHP 7.4 compatibility fixes
1 parent 9a13743 commit 9bc747e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Caching/Storages/FileStorage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ private function verify(array $meta)
115115
if (!empty($meta[self::META_ITEMS])) {
116116
foreach ($meta[self::META_ITEMS] as $depFile => $time) {
117117
$m = $this->readMetaAndLock($depFile, LOCK_SH);
118-
if ($m[self::META_TIME] !== $time || ($m && !$this->verify($m))) {
118+
if ((isset($m[self::META_TIME]) ? $m[self::META_TIME] : null) !== $time || ($m && !$this->verify($m))) {
119119
break 2;
120120
}
121121
}
@@ -161,7 +161,7 @@ public function write($key, $data, array $dp)
161161
foreach ((array) $dp[Cache::ITEMS] as $item) {
162162
$depFile = $this->getCacheFile($item);
163163
$m = $this->readMetaAndLock($depFile, LOCK_SH);
164-
$meta[self::META_ITEMS][$depFile] = $m[self::META_TIME]; // may be null
164+
$meta[self::META_ITEMS][$depFile] = isset($m[self::META_TIME]) ? $m[self::META_TIME] : null;
165165
unset($m);
166166
}
167167
}

0 commit comments

Comments
 (0)