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

@ -52,19 +52,19 @@ class Country_Default extends Country {
* @param array $attributes The country attributes.
* @return \WP_Ultimo\Country\Country
*/
public static function build($code, $name = null, $attributes = array()) {
public static function build($code, $name = null, $attributes = []) {
$instance = new self();
$instance->name = $name ? $name : wu_get_country_name($code);
$instance->name = $name ?: wu_get_country_name($code);
$instance->attributes = wp_parse_args(
$attributes,
array(
[
'country_code' => strtoupper($code),
'currency' => strtoupper($code),
'phone_code' => 00,
)
]
);
return $instance;