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
.phpcs.xml.distcomposer.jsonconstants.php
inc
admin-pages
class-about-admin-page.phpclass-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-checkout-form-list-admin-page.phpclass-customer-edit-admin-page.phpclass-customer-list-admin-page.phpclass-customizer-admin-page.phpclass-dashboard-admin-page.phpclass-discount-code-edit-admin-page.phpclass-discount-code-list-admin-page.phpclass-domain-edit-admin-page.phpclass-domain-list-admin-page.phpclass-edit-admin-page.phpclass-email-edit-admin-page.phpclass-email-list-admin-page.phpclass-email-template-customize-admin-page.phpclass-event-list-admin-page.phpclass-event-view-admin-page.phpclass-hosting-integration-wizard-admin-page.phpclass-invoice-template-customize-admin-page.phpclass-jobs-list-admin-page.phpclass-list-admin-page.phpclass-membership-edit-admin-page.phpclass-membership-list-admin-page.phpclass-migration-alert-admin-page.phpclass-payment-edit-admin-page.phpclass-payment-list-admin-page.phpclass-placeholders-admin-page.phpclass-product-edit-admin-page.phpclass-product-list-admin-page.phpclass-settings-admin-page.phpclass-setup-wizard-admin-page.phpclass-shortcodes-admin-page.phpclass-site-edit-admin-page.phpclass-site-list-admin-page.phpclass-system-info-admin-page.phpclass-tax-rates-admin-page.phpclass-template-previewer-customize-admin-page.phpclass-top-admin-nav-menu.phpclass-view-logs-admin-page.phpclass-webhook-edit-admin-page.phpclass-webhook-list-admin-page.phpclass-wizard-admin-page.php
customer-panel
debug
api
builders
checkout
class-cart.phpclass-checkout-pages.phpclass-checkout.phpclass-legacy-checkout.phpclass-line-item.php
signup-fields
class-admin-notices.phpclass-admin-themes-compatibility.phpclass-ajax.phpclass-api.phpclass-async-calls.phpclass-autoloader.phpclass-cron.phpclass-current.phpclass-dashboard-statistics.phpclass-dashboard-widgets.phpclass-documentation.phpclass-domain-mapping.phpclass-faker.phpclass-geolocation.phpclass-helper.phpclass-hooks.phpclass-license.phpclass-light-ajax.phpclass-logger.phpclass-maintenance-mode.phpclass-newsletter.phpclass-requirements.phpclass-scripts.phpclass-session-cookie.phpclass-settings.phpclass-sunrise.phpclass-user-switching.phpclass-views.phpclass-whitelabel.phpclass-wp-ultimo.php
compat
contracts
country
database
debug
deprecated
development
domain-mapping
duplication
exception
functions
gateways
helpers
installers
integrations
internal
invoices
limitations
limits
list-tables
loaders
managers
models
objects
site-templates
sso
tax
traits
ui
updater
sunrise.php
tests
uninstall.php
views
about.phpadmin-notices.php
admin-pages
base
broadcast
checkout
customers
dashboard-statistics
dashboard-widgets
domain
dynamic-styles
emails
events
invoice
legacy
limitations
memberships
payments
settings
shortcodes
sites
system-info
taxes
ui
wizards
wp-multisite-waas.php

@ -12,7 +12,7 @@ namespace WP_Ultimo\List_Tables;
// Exit if accessed directly
defined('ABSPATH') || exit;
use \WP_Ultimo\Helpers\Hash;
use WP_Ultimo\Helpers\Hash;
/**
* Payment List Table class.
@ -22,11 +22,11 @@ use \WP_Ultimo\Helpers\Hash;
class Payment_List_Table_Widget extends Base_List_Table {
/**
* Holds the query class for the object being listed.
*
* @since 2.0.0
* @var string
*/
* Holds the query class for the object being listed.
*
* @since 2.0.0
* @var string
*/
protected $query_class = '\\WP_Ultimo\\Database\\Payments\\Payment_Query';
/**
@ -36,13 +36,14 @@ class Payment_List_Table_Widget extends Base_List_Table {
*/
public function __construct() {
parent::__construct(array(
'singular' => __('Payment', 'wp-ultimo'), // singular name of the listed records
'plural' => __('Payments', 'wp-ultimo'), // plural name of the listed records
'ajax' => true // does this table support ajax?
));
} // end __construct;
parent::__construct(
array(
'singular' => __('Payment', 'wp-ultimo'), // singular name of the listed records
'plural' => __('Payments', 'wp-ultimo'), // plural name of the listed records
'ajax' => true, // does this table support ajax?
)
);
}
/**
* Uses the query class to return the items to be displayed.
@ -71,18 +72,14 @@ class Payment_List_Table_Widget extends Base_List_Table {
* Accounts for hashes
*/
if (isset($query_args['search']) && strlen((string) $query_args['search']) === Hash::LENGTH) {
$item_id = Hash::decode($query_args['search']);
if ($item_id) {
unset($query_args['search']);
$query_args['id'] = $item_id;
} // end if;
} // end if;
}
}
$query_args = array_merge($query_args, $this->get_extra_query_fields());
@ -91,18 +88,13 @@ class Payment_List_Table_Widget extends Base_List_Table {
$function_name = 'wu_get_' . $query_class->get_plural_name();
if (function_exists($function_name)) {
$query = $function_name($query_args);
} else {
$query = $query_class->query($query_args);
} // end if;
}
return $query;
} // end get_items;
}
/**
* Displays the payment reference code.
*
@ -126,8 +118,7 @@ class Payment_List_Table_Widget extends Base_List_Table {
$html = "<span class='wu-font-mono'><strong>{$code}</strong></span>";
return $html . $this->row_actions($actions);
} // end column_hash;
}
/**
* Displays the membership photo and special status.
@ -144,8 +135,7 @@ class Payment_List_Table_Widget extends Base_List_Table {
$class = $item->get_status_class();
return "<span class='wu-bg-gray-200 wu-text-gray-700 wu-py-1 wu-px-2 wu-rounded-sm wu-text-xs wu-font-mono $class'>{$label}</span>";
} // end column_status;
}
/**
@ -160,8 +150,7 @@ class Payment_List_Table_Widget extends Base_List_Table {
$customer = $item->get_customer();
if (!$customer) {
if ( ! $customer) {
$not_found = __('No customer found', 'wp-ultimo');
return "<div class='wu-py-1 wu-px-2 wu-flex wu-flex-grow wu-rounded wu-items-center wu-border wu-border-solid wu-border-gray-300 wu-bg-gray-100 wu-relative wu-overflow-hidden'>
@ -170,17 +159,22 @@ class Payment_List_Table_Widget extends Base_List_Table {
<span class='wu-block wu-py-3 wu-text-gray-600 wu-text-2xs wu-font-bold wu-uppercase'>{$not_found}</span>
</div>
</div>";
} // end if;
}
$url_atts = array(
'id' => $customer->get_id(),
);
$avatar = get_avatar($customer->get_user_id(), 32, 'identicon', '', array(
'force_display' => true,
'class' => 'wu-rounded-full wu-mr-2',
));
$avatar = get_avatar(
$customer->get_user_id(),
32,
'identicon',
'',
array(
'force_display' => true,
'class' => 'wu-rounded-full wu-mr-2',
)
);
$display_name = $customer->get_display_name();
@ -198,8 +192,7 @@ class Payment_List_Table_Widget extends Base_List_Table {
</a>";
return $html;
} // end column_customer;
}
/**
* Displays the column for the total amount of the payment.
*
@ -212,8 +205,7 @@ class Payment_List_Table_Widget extends Base_List_Table {
$gateway = wu_slug_to_name($item->get_gateway());
return wu_format_currency($item->get_total()) . "<small class='wu-block'>{$gateway}</small>";
} // end column_total;
}
/**
* Returns the list of columns for this particular List Table.
@ -231,8 +223,7 @@ class Payment_List_Table_Widget extends Base_List_Table {
);
return $columns;
} // end get_columns;
}
/**
* Returns the filters for this page.
@ -240,7 +231,7 @@ class Payment_List_Table_Widget extends Base_List_Table {
* @since 2.0.0
* @return void.
*/
public function get_filters() {} // end get_filters;
public function get_filters() {}
/**
* Overrides the parent method to include the custom ajax functionality for WP Multisite WaaS.
@ -248,6 +239,5 @@ class Payment_List_Table_Widget extends Base_List_Table {
* @since 2.0.0
* @return void
*/
public function _js_vars() {} // end _js_vars;
} // end class Payment_List_Table_Widget;
public function _js_vars() {}
}