diff options
author | wn_ <[email protected]> | 2022-08-12 15:31:19 +0000 |
---|---|---|
committer | wn_ <[email protected]> | 2022-08-12 17:58:38 +0000 |
commit | 3487c922b3f34449fecdddebe1fd2ee3b8c42e65 (patch) | |
tree | 57b18bf1a6ec210aa26a80cf1f2d2fdf0888f5da /plugins/cache_starred_images | |
parent | a63c949a5522a8fdeae2dfa77bb39565727f7a0a (diff) |
Replace use of 'array_merge' with the spread operator and 'array_push' in various places.
This isn't supported for arrays with string keys until PHP 8.1.
https://wiki.php.net/rfc/spread_operator_for_array
Diffstat (limited to 'plugins/cache_starred_images')
-rwxr-xr-x | plugins/cache_starred_images/init.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/cache_starred_images/init.php b/plugins/cache_starred_images/init.php index feec81d62..eed5264c6 100755 --- a/plugins/cache_starred_images/init.php +++ b/plugins/cache_starred_images/init.php @@ -84,10 +84,10 @@ class Cache_Starred_Images extends Plugin { Debug::log("expiring {$this->cache->get_dir()} and {$this->cache_status->get_dir()}..."); - $files = array_merge( - glob($this->cache->get_dir() . "/*-*"), - glob($this->cache_status->get_dir() . "/*.status") - ); + $files = [ + ...(glob($this->cache->get_dir() . "/*-*") ?: []), + ...(glob($this->cache_status->get_dir() . "/*.status") ?: []), + ]; asort($files); |