Skip to content

Commit

Permalink
Fixed: Trying to get property 'PakkeshopData' of non-object
Browse files Browse the repository at this point in the history
  • Loading branch information
igormukhingmailcom committed Aug 13, 2020
1 parent cbd2be5 commit e4f425a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Client/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ public function getAllParcelShops(string $countryCode): array
}

$parcelShops = [];
foreach ($result->GetAllParcelShopsResult->PakkeshopData as $parcelShop) {
$parcelShops[] = ParcelShop::createFromStdClass($parcelShop);
foreach ($result->GetAllParcelShopsResult as $parcelShopsResult) {
if (!isset($parcelShopsResult->PakkeshopData)) {
continue;
}

foreach ($parcelShopsResult->PakkeshopData as $parcelShop) {
$parcelShops[] = ParcelShop::createFromStdClass($parcelShop);
}
}

return $parcelShops;
Expand Down

0 comments on commit e4f425a

Please sign in to comment.