From 9f4493d4b7ddc26adb456de24d7f9f9e8b2e794b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Fernanda=20Magallanes?= <35668326+MaferMazu@users.noreply.github.com> Date: Wed, 20 Dec 2023 17:12:23 -0400 Subject: [PATCH] fix: improve namespace and variables naming (#65) * refactor: improve namespace naming * refactor: add prefix to styles * refactor: add prefix to forms and some variables * fix: follow the phpcs conventions * refactor: add openedx preffix to enrollment_order_id and enrollment_request_type --- admin/class-openedx-commerce-admin.php | 26 ++-- admin/css/class-openedx-commerce-admin.css | 18 +-- ...-openedx-commerce-enrollment-info-form.php | 64 ++++----- .../views/class-openedx-commerce-settings.php | 6 +- composer.json | 14 +- includes/class-openedx-commerce-activator.php | 2 +- .../class-openedx-commerce-deactivator.php | 2 +- includes/class-openedx-commerce-i18n.php | 2 +- includes/class-openedx-commerce-loader.php | 2 +- includes/class-openedx-commerce.php | 10 +- .../class-openedx-commerce-api-calls.php | 136 +++++++++--------- .../class-openedx-commerce-enrollment.php | 112 +++++++-------- includes/model/class-openedx-commerce-log.php | 10 +- .../class-openedx-commerce-post-type.php | 2 +- openedx-commerce.php | 6 +- public/class-openedx-commerce-public.php | 2 +- test/class-enrollment-test.php | 8 +- utils/openedx-utils.php | 2 +- 18 files changed, 212 insertions(+), 212 deletions(-) diff --git a/admin/class-openedx-commerce-admin.php b/admin/class-openedx-commerce-admin.php index 292e7cd..81b7b4f 100644 --- a/admin/class-openedx-commerce-admin.php +++ b/admin/class-openedx-commerce-admin.php @@ -9,12 +9,12 @@ * @since 1.0.0 */ -namespace App\admin; +namespace OpenedXCommerce\admin; -use App\model\Openedx_Commerce_Enrollment; -use App\model\Openedx_Commerce_Post_Type; -use App\admin\views\Openedx_Commerce_Enrollment_Info_Form; -use App\utils; +use OpenedXCommerce\model\Openedx_Commerce_Enrollment; +use OpenedXCommerce\model\Openedx_Commerce_Post_Type; +use OpenedXCommerce\admin\views\Openedx_Commerce_Enrollment_Info_Form; +use OpenedXCommerce\utils; /** * The admin-specific functionality of the plugin. @@ -316,7 +316,7 @@ public function add_admin_order_item_values( $product, $item, $item_id = null ) $order_url = esc_url( admin_url( 'post.php?post=' . intval( $input_value ) . '&action=edit' ) ); $html_output = '