From 8678ed8685be37f3a6d87a1bcfee314ffbaaf3a2 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Fri, 9 Mar 2018 09:53:10 -0300 Subject: [PATCH 01/13] Fix phpcs violations using phpcbf --- .../gateways/bacs/class-wc-gateway-bacs.php | 147 +++++++------- .../cheque/class-wc-gateway-cheque.php | 24 +-- .../gateways/class-wc-payment-gateway-cc.php | 10 +- .../class-wc-payment-gateway-echeck.php | 15 +- .../gateways/cod/class-wc-gateway-cod.php | 40 ++-- .../paypal/class-wc-gateway-paypal.php | 113 ++++++----- .../class-wc-gateway-paypal-api-handler.php | 8 +- .../class-wc-gateway-paypal-pdt-handler.php | 20 +- .../class-wc-gateway-paypal-request.php | 177 ++++++++++------- .../class-wc-gateway-paypal-response.php | 6 +- ...ss-wc-addons-gateway-simplify-commerce.php | 92 ++++----- .../class-wc-gateway-simplify-commerce.php | 182 +++++++++--------- 12 files changed, 453 insertions(+), 381 deletions(-) diff --git a/includes/gateways/bacs/class-wc-gateway-bacs.php b/includes/gateways/bacs/class-wc-gateway-bacs.php index 1e155df98f2..3e809de3afa 100644 --- a/includes/gateways/bacs/class-wc-gateway-bacs.php +++ b/includes/gateways/bacs/class-wc-gateway-bacs.php @@ -41,7 +41,8 @@ class WC_Gateway_BACS extends WC_Payment_Gateway { $this->instructions = $this->get_option( 'instructions' ); // BACS account fields shown on the thanks page and in emails - $this->account_details = get_option( 'woocommerce_bacs_accounts', + $this->account_details = get_option( + 'woocommerce_bacs_accounts', array( array( 'account_name' => $this->get_option( 'account_name' ), @@ -69,27 +70,27 @@ class WC_Gateway_BACS extends WC_Payment_Gateway { public function init_form_fields() { $this->form_fields = array( - 'enabled' => array( + 'enabled' => array( 'title' => __( 'Enable/Disable', 'woocommerce' ), 'type' => 'checkbox', 'label' => __( 'Enable bank transfer', 'woocommerce' ), 'default' => 'no', ), - 'title' => array( + 'title' => array( 'title' => __( 'Title', 'woocommerce' ), 'type' => 'text', 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ), 'default' => __( 'Direct bank transfer', 'woocommerce' ), 'desc_tip' => true, ), - 'description' => array( + 'description' => array( 'title' => __( 'Description', 'woocommerce' ), 'type' => 'textarea', 'description' => __( 'Payment method description that the customer will see on your checkout.', 'woocommerce' ), 'default' => __( 'Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order will not be shipped until the funds have cleared in our account.', 'woocommerce' ), 'desc_tip' => true, ), - 'instructions' => array( + 'instructions' => array( 'title' => __( 'Instructions', 'woocommerce' ), 'type' => 'textarea', 'description' => __( 'Instructions that will be added to the thank you page and emails.', 'woocommerce' ), @@ -97,7 +98,7 @@ class WC_Gateway_BACS extends WC_Payment_Gateway { 'desc_tip' => true, ), 'account_details' => array( - 'type' => 'account_details', + 'type' => 'account_details', ), ); @@ -112,8 +113,8 @@ class WC_Gateway_BACS extends WC_Payment_Gateway { ob_start(); - $country = WC()->countries->get_base_country(); - $locale = $this->get_country_locale(); + $country = WC()->countries->get_base_country(); + $locale = $this->get_country_locale(); // Get sortcode label in the $locale array and use appropriate one $sortcode = isset( $locale[ $country ]['sortcode']['label'] ) ? $locale[ $country ]['sortcode']['label'] : __( 'Sort code', 'woocommerce' ); @@ -243,8 +244,8 @@ class WC_Gateway_BACS extends WC_Payment_Gateway { * Add content to the WC emails. * * @param WC_Order $order - * @param bool $sent_to_admin - * @param bool $plain_text + * @param bool $sent_to_admin + * @param bool $plain_text */ public function email_instructions( $order, $sent_to_admin, $plain_text = false ) { @@ -269,11 +270,11 @@ class WC_Gateway_BACS extends WC_Payment_Gateway { } // Get order and store in $order - $order = wc_get_order( $order_id ); + $order = wc_get_order( $order_id ); // Get the order country and country $locale - $country = $order->get_billing_country(); - $locale = $this->get_country_locale(); + $country = $order->get_billing_country(); + $locale = $this->get_country_locale(); // Get sortcode label in the $locale array and use appropriate one $sortcode = isset( $locale[ $country ]['sortcode']['label'] ) ? $locale[ $country ]['sortcode']['label'] : __( 'Sort code', 'woocommerce' ); @@ -294,28 +295,30 @@ class WC_Gateway_BACS extends WC_Payment_Gateway { $account_html .= '