AbstractProvider.php 800 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4. * This file is part of the Geocoder package.
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. *
  8. * @license MIT License
  9. */
  10. namespace Geocoder\Provider;
  11. use Geocoder\Location;
  12. use Geocoder\Model\Address;
  13. /**
  14. * @author William Durand <william.durand1@gmail.com>
  15. */
  16. abstract class AbstractProvider implements Provider
  17. {
  18. /**
  19. * Returns the results for the 'localhost' special case.
  20. *
  21. * @return Location
  22. */
  23. protected function getLocationForLocalhost(): Location
  24. {
  25. return Address::createFromArray([
  26. 'providedBy' => $this->getName(),
  27. 'locality' => 'localhost',
  28. 'country' => 'localhost',
  29. ]);
  30. }
  31. }