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

@ -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;
}
/**