Skip to content
Permalink
Browse files

PHP 7.4 compatibility fixes

  • Loading branch information...
dg committed Aug 6, 2019
1 parent 127240a commit 3119f59bb46500d4ce248d65e1dc4a10f2503173
Showing with 2 additions and 2 deletions.
  1. +2 −2 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[self::META_TIME] ?? null) !== $time || ($m && !$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;
unset($m);
}
}

0 comments on commit 3119f59

Please sign in to comment.
You can’t perform that action at this time.