Skip to content

Commit

Permalink
PHP 7.4 compatibility fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Aug 7, 2019
1 parent 127240a commit 3d1ddc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Caching/Storages/FileStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 3d1ddc7

Please sign in to comment.