refactor(autoload): migrate theme classes to Composer PSR-4
Move 288 types from global AKSRT_* + inc/classes manual requires into
namespace AKSRT\{Domain} under src/AKSRT/, wire composer.json psr-4,
and slim bootstrap to helpers/modules/hooks only. Split multi-class
widget/gateway files, update admin contract audit paths, and document
the layout in ADR/README.
This commit is contained in:
1 parent
8f349b40fb
commit
aaf458af1c
404 files changed
+13602
-7705
No files matched your search
@@ -15,11 +15,11 @@ if (!function_exists('aksrt_coupon_usage_exists')) {
|
||||
* Whether a coupon_usage row already exists for this order.
|
||||
*/
|
||||
function aksrt_coupon_usage_exists(string $order_number): bool {
|
||||
if ($order_number === '' || !class_exists('AKSRT_DB_Migrator')) {
|
||||
if ($order_number === '' || !class_exists('\AKSRT\Core\DBMigrator')) {
|
||||
return false;
|
||||
}
|
||||
global $wpdb;
|
||||
$table = AKSRT_DB_Migrator::table('coupon_usage');
|
||||
$table = \AKSRT\Core\DBMigrator::table('coupon_usage');
|
||||
if ($table === '') {
|
||||
return false;
|
||||
}
|
||||
@@ -39,7 +39,7 @@ if (!function_exists('aksrt_burn_order_coupon')) {
|
||||
* @return bool True when a burn was attempted (or already burned).
|
||||
*/
|
||||
function aksrt_burn_order_coupon(string $order_number, array $meta, int $buyer_id = 0): bool {
|
||||
if ($order_number === '' || !class_exists('AKSRT_Coupon')) {
|
||||
if ($order_number === '' || !class_exists('\AKSRT\Payment\Coupon')) {
|
||||
return false;
|
||||
}
|
||||
if (aksrt_coupon_usage_exists($order_number)) {
|
||||
@@ -53,7 +53,7 @@ if (!function_exists('aksrt_burn_order_coupon')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$coupon_api = AKSRT_Coupon::get_instance();
|
||||
$coupon_api = \AKSRT\Payment\Coupon::get_instance();
|
||||
$coupon_api->use_coupon($coupon_code);
|
||||
|
||||
// Prefer snapshot id: post-increment validate may fail on usage_limit edge.
|
||||
|
||||
Reference in new issue
Block a user