Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit 189f6af

Browse files
committed
Fix PHPCS issues
1 parent aff4ebb commit 189f6af

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

includes/class-wc-subscriptions-addresses.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ public static function add_edit_address_subscription_action( $actions, $subscrip
6868
'update_subscription_address' => $subscription->get_id(),
6969
'wcs_nonce' => wp_create_nonce( 'wcs_edit_address_' . $subscription->get_id() ),
7070
),
71-
wc_get_checkout_url() );
71+
wc_get_checkout_url()
72+
);
7273
} else {
7374
$edit_address_url = add_query_arg( array( 'subscription' => $subscription->get_id() ), wc_get_endpoint_url( 'edit-address', 'shipping' ) );
7475
}

includes/class-wc-subscriptions-change-address-via-checkout-handler.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,19 @@ public static function init() {
5353
add_action( 'woocommerce_order_needs_payment', array( __CLASS__, 'order_does_not_need_payment' ), 10, 2 );
5454
add_action( 'woocommerce_get_checkout_order_received_url', array( __CLASS__, 'change_order_received_url' ), 10, 2 );
5555
add_action( 'woocommerce_store_api_checkout_order_processed', array( __CLASS__, 'process_request' ) );
56-
//woocommerce_order_item_quantity -- dont reserve stock for this order.
57-
//woocommerce_get_checkout_order_received_url --- change the order's redirect URL to send the customer back to the subscription page.
5856

59-
//add_filter( 'woocommerce_enqueue_styles', array( __CLASS__, 'enqueue_styles' ), 100, 1 );
6057
add_action( 'wp_enqueue_scripts', [ __CLASS__, 'register_scripts' ] );
6158

6259
add_filter( 'woocommerce_order_button_text', array( __CLASS__, 'order_button_text' ) );
6360

64-
add_action( 'woocommerce_subscription_payment_complete', function( $subscription ) {
65-
error_log('RUNNING woocommerce_subscription_payment_complete');
66-
} );
61+
add_action(
62+
'woocommerce_subscription_payment_complete',
63+
function(
64+
$subscription
65+
) {
66+
error_log( 'RUNNING woocommerce_subscription_payment_complete' );
67+
}
68+
);
6769
}
6870

6971
/**
@@ -178,18 +180,18 @@ public static function maybe_add_subscription_to_cart_for_address_change() {
178180
public static function crumbs_for_address_change( $crumbs ) {
179181

180182
if ( ! is_main_query() && ! is_page() && ! is_checkout() ) {
181-
error_log(1);
183+
error_log( 1 );
182184
return $crumbs;
183185
}
184186

185187
if ( ! isset( $_GET['update_subscription_address'] ) && ! self::cart_contains_change_address_request() ) {
186-
error_log(2);
188+
error_log( 2 );
187189
return $crumbs;
188190
}
189191

190192
if ( isset( $_GET['update_subscription_address'] ) ) {
191193
$subscription = wcs_get_subscription( absint( $_GET['update_subscription_address'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
192-
} else {
194+
} else {
193195
$subscription = self::get_subscription_from_cart();
194196
}
195197

includes/class-wcs-cart-change-address.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* @package WooCommerce Subscriptions
1010
* @subpackage WCS_Cart_Resubscribe
1111
* @category Class
12-
* @author Prospress
1312
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v2.0
1413
*/
1514

@@ -34,9 +33,13 @@ public function __construct() {
3433
* @return void
3534
*/
3635
public function add_subscription_to_cart( $subscription ) {
37-
$this->setup_cart( $subscription, array(
38-
'subscription_id' => $subscription->get_id(),
39-
), 'all_items_required' );
36+
$this->setup_cart(
37+
$subscription,
38+
array(
39+
'subscription_id' => $subscription->get_id(),
40+
),
41+
'all_items_required'
42+
);
4043
}
4144

4245
/**

0 commit comments

Comments
 (0)