Skip to content

Commit

Permalink
NOISSUE - refactor service
Browse files Browse the repository at this point in the history
  • Loading branch information
olekans committed Jun 13, 2024
1 parent f7d3573 commit 592a023
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Service/ParcelShopsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ public function getParcelShopCollection(

$parcelShopCollection = [];
foreach ($rawParcelShopCollection as $rawParcelShop) {
$openings = $this->getOpenings($rawParcelShop->pclshopid);
try {
$openings = $this->getOpenings($rawParcelShop->pclshopid);
} catch (\Throwable $throwable) {
$openings = [];
}

$parcelShop = ParcelShop::fromRawParcelShop($rawParcelShop, $openings);
$parcelShopCollection[] = $parcelShop;
Expand Down Expand Up @@ -102,10 +106,6 @@ public function getOpenings(string $shopId): array
);
$response = $this->client->request($request);

try {
return $this->serializer->decodeResponse(sprintf('%s[]', Openings::class), $response);
} catch (\Throwable $throwable) {
return [];
}
return $this->serializer->decodeResponse(sprintf('%s[]', Openings::class), $response);
}
}

0 comments on commit 592a023

Please sign in to comment.