Skip to content

Commit

Permalink
fix phpcs + phpmd
Browse files Browse the repository at this point in the history
  • Loading branch information
livca-smile committed Apr 22, 2024
1 parent 7be5d4a commit ce6c4c6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Block/Catalog/Product/Retailer/Availability.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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(),
[
Expand All @@ -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();
Expand Down

0 comments on commit ce6c4c6

Please sign in to comment.