Skip to content

Commit 5606520

Browse files
authored
Simplify FileCacheStorage
1 parent ed39e61 commit 5606520

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Cache/FileCacheStorage.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ private function makeDir(string $directory): void
4040
*/
4141
public function load(string $key, string $variableKey)
4242
{
43-
return (function (string $key, string $variableKey) {
44-
[,, $filePath] = $this->getFilePaths($key);
43+
[,, $filePath] = $this->getFilePaths($key);
44+
45+
return (static function () use ($variableKey, $filePath) {
4546
if (!is_file($filePath)) {
4647
return null;
4748
}
@@ -55,7 +56,7 @@ public function load(string $key, string $variableKey)
5556
}
5657

5758
return $cacheItem->getData();
58-
})($key, $variableKey);
59+
})();
5960
}
6061

6162
/**

0 commit comments

Comments
 (0)