Geocoder.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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;
  11. use Geocoder\Provider\Provider;
  12. /**
  13. * @author William Durand <william.durand1@gmail.com>
  14. */
  15. interface Geocoder extends Provider
  16. {
  17. /**
  18. * Version of this package.
  19. */
  20. const MAJOR_VERSION = 4;
  21. const VERSION = '4.0';
  22. /**
  23. * The default result limit.
  24. */
  25. const DEFAULT_RESULT_LIMIT = 5;
  26. /**
  27. * Geocodes a given value.
  28. *
  29. * @param string $value
  30. *
  31. * @return Collection
  32. *
  33. * @throws \Geocoder\Exception\Exception
  34. */
  35. public function geocode(string $value): Collection;
  36. /**
  37. * Reverses geocode given latitude and longitude values.
  38. *
  39. * @param float $latitude
  40. * @param float $longitude
  41. *
  42. * @return Collection
  43. *
  44. * @throws \Geocoder\Exception\Exception
  45. */
  46. public function reverse(float $latitude, float $longitude): Collection;
  47. }