Use PHP 7.4 featers and PHP 8 polyfills
This commit is contained in:
@@ -30,7 +30,7 @@ abstract class Enum {
|
||||
* @since 2.0.0
|
||||
* @var array
|
||||
*/
|
||||
static $options = array();
|
||||
static $options = [];
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
@@ -69,7 +69,7 @@ abstract class Enum {
|
||||
*/
|
||||
protected function icon_classes() {
|
||||
|
||||
return array();
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -223,10 +223,10 @@ abstract class Enum {
|
||||
public function exists_or_default($array, $key, $default = '') {
|
||||
|
||||
if (empty($default)) {
|
||||
$default = isset($array[ static::__default ]) ? $array[ static::__default ] : '';
|
||||
$default = $array[ static::__default ] ?? '';
|
||||
}
|
||||
|
||||
return isset($array[ $key ]) ? $array[ $key ] : $default;
|
||||
return $array[ $key ] ?? $default;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user