AddressToString.php 706 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. declare(strict_types=1);
  7. namespace Magento\InventoryDistanceBasedSourceSelection\Model\Convert;
  8. use Magento\InventorySourceSelectionApi\Api\Data\AddressInterface;
  9. class AddressToString
  10. {
  11. /**
  12. * Get string from address
  13. *
  14. * @param AddressInterface $address
  15. * @return string
  16. */
  17. public function execute(AddressInterface $address): string
  18. {
  19. return implode(' ', [
  20. $address->getStreet(),
  21. $address->getPostcode(),
  22. $address->getCity(),
  23. $address->getRegion(),
  24. $address->getCountry(),
  25. ]);
  26. }
  27. }