From ce6c4c672e8d2f724f71ed831cdbdbe531bebbe2 Mon Sep 17 00:00:00 2001 From: livca Date: Mon, 22 Apr 2024 15:27:41 +0200 Subject: [PATCH] fix phpcs + phpmd --- Block/Catalog/Product/Retailer/Availability.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Block/Catalog/Product/Retailer/Availability.php b/Block/Catalog/Product/Retailer/Availability.php index f0f72cf..c320821 100644 --- a/Block/Catalog/Product/Retailer/Availability.php +++ b/Block/Catalog/Product/Retailer/Availability.php @@ -37,6 +37,9 @@ class Availability extends Template implements IdentityInterface protected Registry $coreRegistry; protected ?array $storeOffers = null; + /** + * @SuppressWarnings(PHPMD.ExcessiveParameterList) + */ public function __construct( Context $context, protected ProductRepositoryInterface $productRepository, @@ -73,8 +76,8 @@ public function getJsLayout() ->helperConfig->getSearchPlaceholder(); // smile-geocoder child - $jsLayout['components']['catalog-product-retailer-availability']['children']['geocoder']['provider'] = $this->map - ->getIdentifier(); + $jsLayout['components']['catalog-product-retailer-availability']['children']['geocoder']['provider'] + = $this->map->getIdentifier(); $jsLayout['components']['catalog-product-retailer-availability']['children']['geocoder'] = array_merge( $jsLayout['components']['catalog-product-retailer-availability']['children']['geocoder'], $this->map->getConfig() @@ -83,7 +86,8 @@ public function getJsLayout() // smile-map child $jsLayout['components']['catalog-product-retailer-availability']['children']['map']['provider'] = $this->map ->getIdentifier(); - $jsLayout['components']['catalog-product-retailer-availability']['children']['map']['markers'] = $this->getStoreOffers(); + $jsLayout['components']['catalog-product-retailer-availability']['children']['map']['markers'] + = $this->getStoreOffers(); $jsLayout['components']['catalog-product-retailer-availability']['children']['map'] = array_merge( $jsLayout['components']['catalog-product-retailer-availability']['children']['map'], $this->map->getConfig() @@ -163,6 +167,7 @@ protected function getStoreOffers(): array 'url' => $this->storeLocatorHelper->getRetailerUrl($retailer), ]; + // phpcs:disable Magento2.Performance.ForeachArrayMerge.ForeachArrayMerge $offer['schedule'] = array_merge( $this->scheduleHelper->getConfig(), [ @@ -171,6 +176,7 @@ protected function getStoreOffers(): array 'specialOpeningHours' => $retailerExtensionInterface->getSpecialOpeningHours(), ] ); + // phpcs:enable if (isset($offerByRetailer[(int) $retailer->getId()])) { $offer['isAvailable'] = (bool) $offerByRetailer[(int) $retailer->getId()]->isAvailable();