Skip to content

Commit

Permalink
Fix phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
Liam Toohey committed Jun 22, 2020
1 parent a3e654b commit c7049e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Model/GetInventoryRequestFromOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ private function getAddressFromOrder(OrderInterface $order): ?AddressInterface
return null;
}

$region = $shippingAddress->getRegion() === '' ? null : $shippingAddress->getRegion();

return $this->addressInterfaceFactory->create([
'country' => $shippingAddress->getCountryId(),
'postcode' => $shippingAddress->getPostcode(),
'street' => implode("\n", $shippingAddress->getStreet()),
'region' => $shippingAddress->getRegion() ?? $shippingAddress->getRegionCode() ?? '',
'region' => $region ?? $shippingAddress->getRegionCode() ?? '',
'city' => $shippingAddress->getCity()
]);
}
Expand Down

0 comments on commit c7049e8

Please sign in to comment.