Everywhere yoda conditions are
This commit is contained in:
inc
admin-pages
class-base-admin-page.phpclass-base-customer-facing-admin-page.phpclass-broadcast-edit-admin-page.phpclass-broadcast-list-admin-page.phpclass-checkout-form-edit-admin-page.phpclass-discount-code-edit-admin-page.phpclass-domain-edit-admin-page.phpclass-edit-admin-page.phpclass-email-edit-admin-page.phpclass-event-view-admin-page.phpclass-list-admin-page.phpclass-membership-edit-admin-page.phpclass-payment-edit-admin-page.phpclass-product-edit-admin-page.phpclass-settings-admin-page.phpclass-setup-wizard-admin-page.phpclass-site-edit-admin-page.phpclass-site-list-admin-page.phpclass-system-info-admin-page.phpclass-view-logs-admin-page.phpclass-webhook-edit-admin-page.php
customer-panel
api
checkout
class-cart.phpclass-checkout-pages.phpclass-checkout.phpclass-legacy-checkout.phpclass-line-item.php
class-ajax.phpclass-api.phpclass-async-calls.phpclass-dashboard-widgets.phpclass-domain-mapping.phpclass-geolocation.phpclass-logger.phpclass-requirements.phpclass-session-cookie.phpclass-settings.phpclass-sunrise.phpclass-user-switching.phpsignup-fields
class-base-signup-field.phpclass-signup-field-checkbox.phpclass-signup-field-order-summary.phpclass-signup-field-period-selection.phpclass-signup-field-pricing-table.phpclass-signup-field-products.phpclass-signup-field-shortcode.phpclass-signup-field-site-url.phpclass-signup-field-steps.phpclass-signup-field-template-selection.php
field-templates
compat
country
database
checkout-forms
discount-codes
domains
engine
events
memberships
payments
posts
products
sites
webhooks
debug
deprecated
development
domain-mapping
duplication
functions
array-helpers.phpcheckout-form.phpcheckout.phpcustomer.phpdate.phpdiscount-code.phpdomain.phpevent.phpfs.phpgateway.phphelper.phplegacy.phpmarkup-helpers.phpmembership.phpmodel.phppages.phppayment.phpproduct.phprest.phpsettings.phpsite.phptax.php
gateways
class-base-gateway.phpclass-base-stripe-gateway.phpclass-free-gateway.phpclass-manual-gateway.phpclass-paypal-gateway.phpclass-stripe-checkout-gateway.phpclass-stripe-gateway.php
helpers
installers
integrations
host-providers
limitations
limits
list-tables
class-base-list-table.phpclass-broadcast-list-table.phpclass-checkout-form-list-table.phpclass-customer-list-table.phpclass-discount-code-list-table.phpclass-domain-list-table.phpclass-email-list-table.phpclass-event-list-table.phpclass-inside-events-list-table.phpclass-membership-list-table-widget.phpclass-membership-list-table.phpclass-payment-list-table-widget.phpclass-product-list-table.phpclass-site-list-table.phpclass-webhook-list-table.php
managers
class-broadcast-manager.phpclass-customer-manager.phpclass-domain-manager.phpclass-event-manager.phpclass-limitation-manager.phpclass-membership-manager.phpclass-notes-manager.phpclass-notification-manager.phpclass-site-manager.php
models
class-base-model.phpclass-checkout-form.phpclass-customer.phpclass-discount-code.phpclass-domain.phpclass-email.phpclass-event.phpclass-membership.phpclass-payment.phpclass-product.phpclass-site.php
traits
objects
site-templates
sso
tax
traits
trait-wp-ultimo-coupon-deprecated.phptrait-wp-ultimo-plan-deprecated.phptrait-wp-ultimo-settings-deprecated.php
ui
class-account-summary-element.phpclass-base-element.phpclass-billing-info-element.phpclass-checkout-element.phpclass-current-membership-element.phpclass-current-site-element.phpclass-domain-mapping-element.phpclass-field.phpclass-invoices-element.phpclass-jumper.phpclass-limits-element.phpclass-login-form-element.phpclass-my-sites-element.phpclass-payment-methods-element.phpclass-simple-text-element.phpclass-site-actions-element.phpclass-site-maintenance-element.phpclass-template-previewer.phpclass-template-switching-element.phpclass-thank-you-element.php
views
admin-pages
checkout
templates
order-bump
order-summary
period-selection
pricing-table
dashboard-statistics
dashboard-widgets
legacy
signup
settings
fields
@@ -26,6 +26,7 @@ class Checkout_Form extends Base_Model {
|
||||
* @var array<string, int>|array<string, string>
|
||||
*/
|
||||
public $meta;
|
||||
|
||||
/**
|
||||
* The name of the checkout form.
|
||||
*
|
||||
@@ -274,6 +275,7 @@ class Checkout_Form extends Base_Model {
|
||||
|
||||
$this->settings = $settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a specific step by the step name.
|
||||
*
|
||||
@@ -289,7 +291,7 @@ class Checkout_Form extends Base_Model {
|
||||
|
||||
$step_key = array_search($step_name, array_column($settings, 'id'), true);
|
||||
|
||||
$step = $step_key !== false ? $settings[ $step_key ] : false;
|
||||
$step = false !== $step_key ? $settings[ $step_key ] : false;
|
||||
|
||||
if ($step) {
|
||||
$step = wp_parse_args(
|
||||
@@ -303,6 +305,7 @@ class Checkout_Form extends Base_Model {
|
||||
|
||||
return $step;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the steps to show in current form
|
||||
*
|
||||
@@ -336,11 +339,11 @@ class Checkout_Form extends Base_Model {
|
||||
foreach ($steps as $key => $step) {
|
||||
$logged = wu_get_isset($step, 'logged', 'always');
|
||||
|
||||
$show = $logged === 'always';
|
||||
$show = 'always' === $logged;
|
||||
|
||||
if ($logged === 'guests_only' && ! $user_exists) {
|
||||
if ('guests_only' === $logged && ! $user_exists) {
|
||||
$show = true;
|
||||
} elseif ($logged === 'logged_only' && $user_exists) {
|
||||
} elseif ('logged_only' === $logged && $user_exists) {
|
||||
$show = true;
|
||||
}
|
||||
|
||||
@@ -369,6 +372,7 @@ class Checkout_Form extends Base_Model {
|
||||
|
||||
return $final_steps;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a specific field by the step name and field name.
|
||||
*
|
||||
@@ -388,7 +392,7 @@ class Checkout_Form extends Base_Model {
|
||||
|
||||
$field_key = array_search($field_name, array_column($step['fields'], 'id'), true);
|
||||
|
||||
return $field_key !== false ? $step['fields'][ $field_key ] : false;
|
||||
return false !== $field_key ? $step['fields'][ $field_key ] : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -488,6 +492,7 @@ class Checkout_Form extends Base_Model {
|
||||
|
||||
return is_array($fields) ? count($fields) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the shortcode that needs to be placed to embed this form.
|
||||
*
|
||||
@@ -510,11 +515,11 @@ class Checkout_Form extends Base_Model {
|
||||
|
||||
$fields = [];
|
||||
|
||||
if ($template === 'multi-step') {
|
||||
if ('multi-step' === $template) {
|
||||
$fields = $this->get_multi_step_template();
|
||||
|
||||
$this->set_settings($fields);
|
||||
} elseif ($template === 'single-step') {
|
||||
} elseif ('single-step' === $template) {
|
||||
$fields = $this->get_single_step_template();
|
||||
}
|
||||
|
||||
@@ -811,7 +816,7 @@ class Checkout_Form extends Base_Model {
|
||||
/**
|
||||
* Deal with special cases.
|
||||
*/
|
||||
if ($step_id === 'plan') {
|
||||
if ('plan' === $step_id) {
|
||||
$products_list = wu_get_plans(
|
||||
[
|
||||
'fields' => 'ids',
|
||||
@@ -873,7 +878,7 @@ class Checkout_Form extends Base_Model {
|
||||
/**
|
||||
* Deal with special cases.
|
||||
*/
|
||||
if ($step_id === 'template' && wu_get_isset($old_settings, 'allow_template', true)) {
|
||||
if ('template' === $step_id && wu_get_isset($old_settings, 'allow_template', true)) {
|
||||
$templates = [];
|
||||
|
||||
foreach (wu_get_site_templates() as $site) {
|
||||
@@ -965,7 +970,7 @@ class Checkout_Form extends Base_Model {
|
||||
$field['type'] = 'submit_button';
|
||||
$field['id'] = 'submit_button';
|
||||
|
||||
if ($step_id === 'account') {
|
||||
if ('account' === $step_id) {
|
||||
$field['name'] = __('Continue to the Next Step', 'wp-ultimo');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user