Skip to content

Commit

Permalink
Provide ECS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubtobiasz committed Sep 12, 2023
1 parent dba1bb7 commit 2a21598
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,14 @@ private function getFindByAddressQueryBuilder(AddressInterface $address, ?string

/**
* @param array<ZoneInterface> $zones
*
* @return array<ZoneInterface>
*/
public function findAllByZones(array $zones, ?string $scope = null): array
{
$zones = array_map(
fn (ZoneInterface $zone): string => $zone->getCode(),
$zones
$zones,
);

$query = $this->createQueryBuilder('z')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function findAllByAddress(AddressInterface $address, ?string $scope = nul

/**
* @param array<ZoneInterface> $zones
*
* @return array<ZoneInterface>
*/
public function findAllByZones(array $zones, ?string $scope = null): array;
Expand Down
3 changes: 2 additions & 1 deletion src/Sylius/Component/Addressing/Matcher/ZoneMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ public function matchAll(AddressInterface $address, ?string $scope = null): arra

return array_filter(
$zonesWithParents,
fn (ZoneInterface $zone) => $zone->getScope() === $scope
fn (ZoneInterface $zone) => $zone->getScope() === $scope,
);
}

/**
* @param array<ZoneInterface> $zones
*
* @return array<ZoneInterface>
*/
private function getZonesWithParentZones(array $zones): array
Expand Down

0 comments on commit 2a21598

Please sign in to comment.