diff --git a/src/SearchMapsPlace.php b/src/SearchMapsPlace.php new file mode 100644 index 0000000..42174d5 --- /dev/null +++ b/src/SearchMapsPlace.php @@ -0,0 +1,67 @@ +mapsPlace = $mapsPlace; + } + + /** + * @param string $city + * @param string $zip + * @param null|string $state + * + * @return Place|null + */ + public function searchZipPlace(string $city, string $zip, ?string $state = null): ?Place + { + return $this->mapsPlace->getPlaceByAddress( + \sprintf('%s-%s-%s', $city, $state, $zip) + ); + } + + /** + * @param string $city + * @param null|string $state + * + * @return Place|null + */ + public function searchCityPlace(string $city, ?string $state = null): ?Place + { + return $this->mapsPlace->getPlaceByAddress( + \sprintf('%s-%s', $city, $state) + ); + } + + /** + * @param string $neighborhood + * @param string $city + * @param null|string $state + * + * @return Place|null + */ + public function searchNeighborhoodPlace(string $neighborhood, string $city, ?string $state = null): ?Place + { + return $this->mapsPlace->getPlaceByAddress( + \sprintf('%s-%s-%s', $neighborhood, $city, $state) + ); + } +}