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
This commit is contained in:
wn_
2022-08-12 15:31:19 +00:00
parent a63c949a55
commit 3487c922b3
17 changed files with 71 additions and 72 deletions

View File

@@ -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);