From f0b6e362b7c29257bfdd730b0da4013aabdab1ac Mon Sep 17 00:00:00 2001 From: David Remer Date: Thu, 2 Jul 2020 14:42:08 +0300 Subject: [PATCH] phpcs --- .../ppcp-wc-gateway/src/Checkout/DisableGateways.php | 8 +++++--- modules.local/ppcp-wc-gateway/src/Gateway/WcGateway.php | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/modules.local/ppcp-wc-gateway/src/Checkout/DisableGateways.php b/modules.local/ppcp-wc-gateway/src/Checkout/DisableGateways.php index 328771f4e..2cbc9c93b 100644 --- a/modules.local/ppcp-wc-gateway/src/Checkout/DisableGateways.php +++ b/modules.local/ppcp-wc-gateway/src/Checkout/DisableGateways.php @@ -17,13 +17,17 @@ class DisableGateways SessionHandler $sessionHandler, ContainerInterface $settings ) { + $this->sessionHandler = $sessionHandler; $this->settings = $settings; } public function handler(array $methods): array { - if (! $this->settings->has('merchant_email') || ! is_email($this->settings->get('merchant_email'))) { + if ( + ! $this->settings->has('merchant_email') + || ! is_email($this->settings->get('merchant_email')) + ) { unset($methods[WcGateway::ID]); return $methods; } @@ -31,8 +35,6 @@ class DisableGateways return $methods; } - - return [WcGateway::ID => $methods[WcGateway::ID]]; } diff --git a/modules.local/ppcp-wc-gateway/src/Gateway/WcGateway.php b/modules.local/ppcp-wc-gateway/src/Gateway/WcGateway.php index 463c45761..918a8a003 100644 --- a/modules.local/ppcp-wc-gateway/src/Gateway/WcGateway.php +++ b/modules.local/ppcp-wc-gateway/src/Gateway/WcGateway.php @@ -55,8 +55,10 @@ class WcGateway extends \WC_Payment_Gateway 'Provide your customers with the PayPal payment system', 'woocommerce-paypal-gateway' ); - $this->title = $this->config->has('title') ? $this->config->get('title') : $this->method_title; - $this->description = $this->config->has('description') ? $this->config->get('description') : $this->method_description; + $this->title = $this->config->has('title') ? + $this->config->get('title') : $this->method_title; + $this->description = $this->config->has('description') ? + $this->config->get('description') : $this->method_description; $this->init_form_fields(); $this->init_settings();