Use new code style

This commit is contained in:
David Stone
2025-02-07 19:02:33 -07:00
parent 0181024ae1
commit 8433379d90
672 changed files with 37107 additions and 45249 deletions

View File

@ -9,8 +9,8 @@
namespace WP_Ultimo\Checkout\Signup_Fields;
use \WP_Ultimo\Checkout\Signup_Fields\Base_Signup_Field;
use \WP_Ultimo\Managers\Gateway_Manager;
use WP_Ultimo\Checkout\Signup_Fields\Base_Signup_Field;
use WP_Ultimo\Managers\Gateway_Manager;
// Exit if accessed directly
defined('ABSPATH') || exit;
@ -33,8 +33,7 @@ class Signup_Field_Payment extends Base_Signup_Field {
public function get_type() {
return 'payment';
} // end get_type;
}
/**
* Returns if this field should be present on the checkout flow or not.
@ -45,8 +44,7 @@ class Signup_Field_Payment extends Base_Signup_Field {
public function is_required() {
return true;
} // end is_required;
}
/**
* Requires the title of the field/element type.
@ -59,8 +57,7 @@ class Signup_Field_Payment extends Base_Signup_Field {
public function get_title() {
return __('Payment', 'wp-ultimo');
} // end get_title;
}
/**
* Returns the description of the field/element.
@ -73,8 +70,7 @@ class Signup_Field_Payment extends Base_Signup_Field {
public function get_description() {
return __('Adds the payment options and the additional fields required to complete a purchase (e.g. credit card field).', 'wp-ultimo');
} // end get_description;
}
/**
* Returns the tooltip of the field/element.
@ -87,8 +83,7 @@ class Signup_Field_Payment extends Base_Signup_Field {
public function get_tooltip() {
return __('Adds the payment options and the additional fields required to complete a purchase (e.g. credit card field).', 'wp-ultimo');
} // end get_tooltip;
}
/**
* Returns the icon to be used on the selector.
@ -101,8 +96,7 @@ class Signup_Field_Payment extends Base_Signup_Field {
public function get_icon() {
return 'dashicons-wu-credit-card2';
} // end get_icon;
}
/**
* Returns the default values for the field-elements.
@ -116,10 +110,9 @@ class Signup_Field_Payment extends Base_Signup_Field {
public function defaults() {
return array(
''
'',
);
} // end defaults;
}
/**
* List of keys of the default fields we want to display on the builder.
@ -132,8 +125,7 @@ class Signup_Field_Payment extends Base_Signup_Field {
return array(
'name',
);
} // end default_fields;
}
/**
* If you want to force a particular attribute to a value, declare it here.
@ -146,8 +138,7 @@ class Signup_Field_Payment extends Base_Signup_Field {
return array(
'id' => 'payment',
);
} // end force_attributes;
}
/**
* Returns the list of additional fields specific to this type.
@ -158,8 +149,7 @@ class Signup_Field_Payment extends Base_Signup_Field {
public function get_fields() {
return array();
} // end get_fields;
}
/**
* Returns the field/element actual field array to be used on the checkout form.
@ -194,8 +184,7 @@ class Signup_Field_Payment extends Base_Signup_Field {
* Checks if we need to add the
* auto renew field.
*/
if (!wu_get_setting('force_auto_renew', 1)) {
if ( ! wu_get_setting('force_auto_renew', 1)) {
$auto_renewable_gateways = Gateway_Manager::get_instance()->get_auto_renewable_gateways();
$fields['auto_renew'] = array(
@ -212,13 +201,10 @@ class Signup_Field_Payment extends Base_Signup_Field {
'wrapper_html_attr' => array(
'v-cloak' => 1,
'v-show' => sprintf('%s.includes(gateway) && order.should_collect_payment && order.has_recurring', json_encode($auto_renewable_gateways)),
)
),
);
} // end if;
}
return $fields;
} // end to_fields_array;
} // end class Signup_Field_Payment;
}
}