Query.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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\Query;
  11. /**
  12. * @author Tobias Nyholm <tobias.nyholm@gmail.com>
  13. */
  14. interface Query
  15. {
  16. /**
  17. * @param string $locale
  18. *
  19. * @return Query
  20. */
  21. public function withLocale(string $locale);
  22. /**
  23. * @param int $limit
  24. *
  25. * @return Query
  26. */
  27. public function withLimit(int $limit);
  28. /**
  29. * @param string $name
  30. * @param mixed $value
  31. *
  32. * @return Query
  33. */
  34. public function withData(string $name, $value);
  35. /**
  36. * @return string|null
  37. */
  38. public function getLocale();
  39. /**
  40. * @return int
  41. */
  42. public function getLimit(): int;
  43. /**
  44. * @param string $name
  45. * @param mixed|null $default
  46. *
  47. * @return mixed
  48. */
  49. public function getData(string $name, $default = null);
  50. /**
  51. * @return array
  52. */
  53. public function getAllData(): array;
  54. /**
  55. * @return string
  56. */
  57. public function __toString();
  58. }