From d0ceb21b0c0675a487a990f067b35261e2b1148b Mon Sep 17 00:00:00 2001 From: Tamara Date: Fri, 27 Sep 2024 17:33:34 +0200 Subject: [PATCH] Fix the return type error CS-5960 --- src/Service/PaymentMethodsService.php | 2 +- src/Subscriber/PaymentSubscriber.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Service/PaymentMethodsService.php b/src/Service/PaymentMethodsService.php index c8aa71e0..e1fe7f11 100644 --- a/src/Service/PaymentMethodsService.php +++ b/src/Service/PaymentMethodsService.php @@ -127,7 +127,7 @@ public function getPaymentMethods(SalesChannelContext $context, $orderId = ''): return CacheValueCompressor::uncompress($paymentMethodsResponseCache->get()); } - $responseData = []; + $responseData = new PaymentMethodsResponse(); try { $paymentsApiService = new PaymentsApi( $this->clientService->getClient($context->getSalesChannelId()) diff --git a/src/Subscriber/PaymentSubscriber.php b/src/Subscriber/PaymentSubscriber.php index a586cc94..8b04500f 100644 --- a/src/Subscriber/PaymentSubscriber.php +++ b/src/Subscriber/PaymentSubscriber.php @@ -238,7 +238,7 @@ public function onShoppingCartLoaded(PageLoadedEvent $event) $giftcards = []; if ($paymentMethod && $paymentMethod->getActive()) { $giftcards = $this->paymentMethodsFilterService->filterAdyenPaymentMethodsByType( - $paymentMethods->getPaymentMethods(), + $paymentMethods->getPaymentMethods() ?? [], 'giftcard' ); }