Use PHP 7.4 featers and PHP 8 polyfills

This commit is contained in:
David Stone
2025-02-08 13:57:32 -07:00
parent 8bea6067cd
commit b41dc2b2eb
550 changed files with 15270 additions and 14627 deletions

View File

@ -42,7 +42,7 @@ class Query extends \BerlinDB\Database\Query {
* @since 2.1.2
* @var array
*/
protected static $added_globals = array();
protected static $added_globals = [];
/**
* Plural version for a group of items.
@ -69,12 +69,12 @@ class Query extends \BerlinDB\Database\Query {
* @param string|array $query Optional. An array or string of Query parameters.
* @return void
*/
public function __construct($query = array()) {
public function __construct($query = []) {
$cache_group = $this->apply_prefix($this->cache_group, '-');
if ($this->global_cache && ! in_array($cache_group, self::$added_globals, true)) {
wp_cache_add_global_groups(array($cache_group));
wp_cache_add_global_groups([$cache_group]);
self::$added_globals[] = $cache_group;
}