diff --git a/modules.local/ppcp-button/src/Assets/SmartButton.php b/modules.local/ppcp-button/src/Assets/SmartButton.php index 98cc327c8..f93b56b8e 100644 --- a/modules.local/ppcp-button/src/Assets/SmartButton.php +++ b/modules.local/ppcp-button/src/Assets/SmartButton.php @@ -48,6 +48,7 @@ class SmartButton implements SmartButtonInterface } // phpcs:disable Inpsyde.CodeQuality.FunctionLength.TooLong + // phpcs:disable Generic.Metrics.CyclomaticComplexity.TooHigh /** * ToDo: Refactor * @return bool @@ -184,6 +185,7 @@ class SmartButton implements SmartButtonInterface return true; } // phpcs:enable Inpsyde.CodeQuality.FunctionLength.TooLong + // phpcs:enable Generic.Metrics.CyclomaticComplexity.TooHigh public function enqueue(): bool { @@ -232,9 +234,12 @@ class SmartButton implements SmartButtonInterface 'url' => $this->url(), 'style' => [ 'layout' => 'vertical', - 'color' => ($this->settings->has('button_color')) ? $this->settings->get('button_color') : null, - 'shape' => ($this->settings->has('button_shape')) ? $this->settings->get('button_shape') : null, - 'label' => ($this->settings->has('button_label')) ? $this->settings->get('button_label') : 'paypal', + 'color' => ($this->settings->has('button_color')) ? + $this->settings->get('button_color') : null, + 'shape' => ($this->settings->has('button_shape')) ? + $this->settings->get('button_shape') : null, + 'label' => ($this->settings->has('button_label')) ? + $this->settings->get('button_label') : 'paypal', ], ], 'hosted_fields' => [ diff --git a/modules.local/ppcp-wc-gateway/src/Gateway/WcGateway.php b/modules.local/ppcp-wc-gateway/src/Gateway/WcGateway.php index 084b8644d..87714e04d 100644 --- a/modules.local/ppcp-wc-gateway/src/Gateway/WcGateway.php +++ b/modules.local/ppcp-wc-gateway/src/Gateway/WcGateway.php @@ -72,7 +72,7 @@ class WcGateway extends \WC_Payment_Gateway ); } - public function needs_setup() + public function needs_setup(): bool { return true; diff --git a/modules.local/ppcp-wc-gateway/src/Processor/OrderProcessor.php b/modules.local/ppcp-wc-gateway/src/Processor/OrderProcessor.php index f8104e764..29b425274 100644 --- a/modules.local/ppcp-wc-gateway/src/Processor/OrderProcessor.php +++ b/modules.local/ppcp-wc-gateway/src/Processor/OrderProcessor.php @@ -46,7 +46,10 @@ class OrderProcessor $errorMessage = null; if (!$order || !$order->status()->is(OrderStatus::APPROVED)) { - $errorMessage = __('The payment has not been approved yet.', 'woocommerce-paypal-commerce-gateway'); + $errorMessage = __( + 'The payment has not been approved yet.', + 'woocommerce-paypal-commerce-gateway' + ); } if ($errorMessage) { $this->lastError = sprintf( @@ -67,9 +70,15 @@ class OrderProcessor $wcOrder->update_meta_data(WcGateway::CAPTURED_META_KEY, 'false'); } - $wcOrder->update_status('on-hold', __('Awaiting payment.', 'woocommerce-paypal-commerce-gateway')); + $wcOrder->update_status( + 'on-hold', + __('Awaiting payment.', 'woocommerce-paypal-commerce-gateway') + ); if ($order->status()->is(OrderStatus::COMPLETED) && $order->intent() === 'CAPTURE') { - $wcOrder->update_status('processing', __('Payment received.', 'woocommerce-paypal-commerce-gateway')); + $wcOrder->update_status( + 'processing', + __('Payment received.', 'woocommerce-paypal-commerce-gateway') + ); } $woocommerce->cart->empty_cart(); $this->sessionHandler->destroySessionData(); diff --git a/modules.local/ppcp-wc-gateway/src/Settings/Settings.php b/modules.local/ppcp-wc-gateway/src/Settings/Settings.php index 959bcde81..d5bf7671c 100644 --- a/modules.local/ppcp-wc-gateway/src/Settings/Settings.php +++ b/modules.local/ppcp-wc-gateway/src/Settings/Settings.php @@ -72,7 +72,10 @@ class Settings implements ContainerInterface $defaults = [ 'title' => __('PayPal', 'woocommerce-paypal-commerce-gateway'), - 'description' => __('Pay via PayPal; you can pay with your credit card if you don\'t have a PayPal account.', 'woocommerce-paypal-commerce-gateway'), + 'description' => __( + 'Pay via PayPal; you can pay with your credit card if you don\'t have a PayPal account.', + 'woocommerce-paypal-commerce-gateway' + ), 'button_single_product_enabled' => true, 'button_mini_cart_enabled' => true, 'button_cart_enabled' => true,