diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2024-12-16 06:29:28 +0000 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2024-12-16 06:29:28 +0000 |
| commit | e990a3c00fb630465996a29d60d9acc7687c8979 (patch) | |
| tree | 6a1071eeb3e1a618ac3fe94bcf8363c6fbbc0bb5 /classes/DiskCache.php | |
| parent | d1c0ba5944e225165a5761e3d9a6620d27aca263 (diff) | |
| parent | 6f8f1b30d508dc3d2c3a067ca7fe2d161963ef5f (diff) | |
Merge branch 'feature/php-misc' into 'master'
More native typing, use some new PHP stuff
See merge request tt-rss/tt-rss!88
Diffstat (limited to 'classes/DiskCache.php')
| -rw-r--r-- | classes/DiskCache.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/classes/DiskCache.php b/classes/DiskCache.php index 249079b36..70b8de173 100644 --- a/classes/DiskCache.php +++ b/classes/DiskCache.php @@ -1,10 +1,9 @@ <?php class DiskCache implements Cache_Adapter { - /** @var Cache_Adapter $adapter */ - private $adapter; + private Cache_Adapter $adapter; /** @var array<string, DiskCache> $instances */ - private static $instances = []; + private static array $instances = []; /** * https://stackoverflow.com/a/53662733 @@ -301,8 +300,11 @@ class DiskCache implements Cache_Adapter { if ($this->exists($local_filename) && !$force) return true; - $data = UrlHelper::fetch(array_merge(["url" => $url, - "max_size" => Config::get(Config::MAX_CACHE_FILE_SIZE)], $options)); + $data = UrlHelper::fetch([ + 'url' => $url, + 'max_size' => Config::get(Config::MAX_CACHE_FILE_SIZE), + ...$options, + ]); if ($data) return $this->put($local_filename, $data) > 0; |