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,9 +52,9 @@ function wu_get_gateways() {
*/
function wu_get_active_gateways() {
$gateways = array();
$gateways = [];
$active_gateways = (array) wu_get_setting('active_gateways', array());
$active_gateways = (array) wu_get_setting('active_gateways', []);
foreach ($active_gateways as $active_gateway) {
if (Gateway_Manager::get_instance()->is_gateway_registered($active_gateway)) {
@ -95,7 +95,7 @@ function wu_get_gateway($id, $subscription = null) {
*/
function wu_get_gateway_as_options() {
$options = array();
$options = [];
foreach (wu_get_gateways() as $gateway_slug => $gateway) {
$instance = class_exists($gateway['class_name']) ? new $gateway['class_name']() : false;
@ -118,7 +118,7 @@ function wu_get_gateway_as_options() {
*/
function wu_get_active_gateway_as_options() {
$options = array();
$options = [];
foreach (wu_get_active_gateways() as $gateway_slug => $gateway) {
$instance = class_exists($gateway['class_name']) ? new $gateway['class_name']() : false;