AddressToQueryString.php 639 B

123456789101112131415161718192021222324252627
  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 AddressToQueryString
  10. {
  11. /**
  12. * Get components string from address
  13. *
  14. * @param AddressInterface $address
  15. * @return string
  16. */
  17. public function execute(AddressInterface $address): string
  18. {
  19. return
  20. $address->getStreet() . ', ' .
  21. $address->getPostcode() . ' ' .
  22. $address->getCity();
  23. }
  24. }