Skip to content

Commit 6edaf25

Browse files
Code Polish
1 parent 0dd5961 commit 6edaf25

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

Block/Page/FastCheckoutFallback.php

-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
class FastCheckoutFallback extends \Magento\Framework\View\Element\Template
1414
{
15-
1615
/**
1716
* @var Request
1817
*/
@@ -73,7 +72,6 @@ public function __construct(
7372
* @return string
7473
*/
7574
protected function _beforeToHtml() // phpcs:ignore
76-
7775
{
7876
return parent::_beforeToHtml();
7977
}

Controller/Checkout/FastCheckoutStart.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public function __construct(
7878

7979
/**
8080
* @param quote $quote
81+
* @param array $params
8182
* @return void
8283
* @phpcs:disable Squiz.Commenting.FunctionComment.TypeHintMissing
8384
*/
@@ -131,7 +132,7 @@ private function quoteSetDummyData($quote, $params)
131132
throw new \Exception('Shipping method not availeble', FastCheckoutStart::FC_ESITMATE_ERROR);
132133
}
133134
}
134-
if (isset($params['selected_estimate_shipping']) && !empty($params['selected_estimate_shipping']) && !empty($shippingMethodsAvaileble[$params['selected_estimate_shipping']]) && $store->getConfig('payment/paynl_payment_ideal/fast_checkout_use_estimate_selection') > 0) {
135+
if (isset($params['selected_estimate_shipping']) && !empty($params['selected_estimate_shipping']) && !empty($shippingMethodsAvaileble[$params['selected_estimate_shipping']]) && $store->getConfig('payment/paynl_payment_ideal/fast_checkout_use_estimate_selection') > 0) { // phpcs:ignore
135136
$shippingMethod = $params['selected_estimate_shipping'];
136137
} elseif (!empty($shippingMethodsAvaileble[$store->getConfig('payment/paynl_payment_ideal/fast_checkout_shipping')])) {
137138
$shippingMethod = $store->getConfig('payment/paynl_payment_ideal/fast_checkout_shipping');
@@ -187,9 +188,7 @@ private function getProducts()
187188
}
188189

189190
/**
190-
* @param quote $quote
191191
* @return void
192-
* @phpcs:disable Squiz.Commenting.FunctionComment.TypeHintMissing
193192
*/
194193
public function cacheShippingMethods()
195194
{
@@ -227,7 +226,7 @@ public function execute()
227226
}
228227
}
229228

230-
if (empty($store->getConfig('payment/paynl_payment_ideal/fast_checkout_shipping')) && (!isset($params['fallbackShippingMethod']) || empty($params['fallbackShippingMethod'])) && (!isset($params['selected_estimate_shipping']) || empty($params['selected_estimate_shipping']))) {
229+
if (empty($store->getConfig('payment/paynl_payment_ideal/fast_checkout_shipping')) && (!isset($params['fallbackShippingMethod']) || empty($params['fallbackShippingMethod'])) && (!isset($params['selected_estimate_shipping']) || empty($params['selected_estimate_shipping']))) { // phpcs:ignore
231230
throw new \Exception('No shipping method selected', FastCheckoutStart::FC_SHIPPING_ERROR);
232231
}
233232

ViewModel/FastCheckout.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace Paynl\Payment\ViewModel;
44

5+
use Magento\Customer\Model\Session;
56
use Magento\Framework\View\Element\Block\ArgumentInterface;
67
use Magento\Store\Model\StoreManagerInterface;
7-
use Magento\Customer\Model\Session;
88

99
class FastCheckout implements ArgumentInterface
1010
{
@@ -20,7 +20,8 @@ class FastCheckout implements ArgumentInterface
2020

2121
/**
2222
* BuyNow constructor.
23-
* @param ScopeConfigInterface $scopeConfig
23+
* @param StoreManagerInterface $storeManager
24+
* @param Session $session
2425
*/
2526
public function __construct(
2627
StoreManagerInterface $storeManager,
@@ -30,15 +31,15 @@ public function __construct(
3031
$this->session = $session;
3132
}
3233

33-
/**
34-
* @return string
34+
/**
35+
* @return boolean
3536
*/
3637
public function getVisibility()
3738
{
3839
$store = $this->storeManager->getStore();
39-
if($this->session->isLoggedIn() && $store->getConfig('payment/paynl_payment_ideal/fast_checkout_guest_only') == 1) {
40+
if ($this->session->isLoggedIn() && $store->getConfig('payment/paynl_payment_ideal/fast_checkout_guest_only') == 1) {
4041
return false;
4142
}
42-
return true;
43+
return true;
4344
}
4445
}

0 commit comments

Comments
 (0)