diff --git a/GoogleMaps.php b/GoogleMaps.php index e40a6c9..cb9d163 100644 --- a/GoogleMaps.php +++ b/GoogleMaps.php @@ -34,12 +34,12 @@ final class GoogleMaps extends AbstractHttpProvider implements Provider /** * @var string */ - const GEOCODE_ENDPOINT_URL_SSL = 'https://maps.googleapis.com/maps/api/geocode/json?address=%s'; + public const GEOCODE_ENDPOINT_URL_SSL = 'https://maps.googleapis.com/maps/api/geocode/json?address=%s'; /** * @var string */ - const REVERSE_ENDPOINT_URL_SSL = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=%F,%F'; + public const REVERSE_ENDPOINT_URL_SSL = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=%F,%F'; /** * @var string|null @@ -152,16 +152,12 @@ public function reverseQuery(ReverseQuery $query): Collection return $this->fetchUrl($url, $query->getLocale(), $query->getLimit(), $query->getData('region', $this->region)); } - /** - * {@inheritdoc} - */ public function getName(): string { return 'google_maps'; } /** - * @param string $url * @param string $locale * * @return string query with extra params @@ -200,13 +196,9 @@ private function buildQuery(string $url, string $locale = null, string $region = } /** - * @param string $url * @param string $locale - * @param int $limit * @param string $region * - * @return AddressCollection - * * @throws InvalidServerResponse * @throws InvalidCredentials */ @@ -280,9 +272,8 @@ private function fetchUrl(string $url, string $locale = null, int $limit, string /** * Update current resultSet with given key/value. * - * @param AddressBuilder $builder - * @param string $type Component type - * @param object $values The component values + * @param string $type Component type + * @param object $values The component values */ private function updateAddressComponent(AddressBuilder $builder, string $type, $values) { @@ -394,10 +385,6 @@ private function signQuery(string $query): string /** * Serialize the component query parameter. - * - * @param array $components - * - * @return string */ private function serializeComponents(array $components): string { @@ -409,7 +396,6 @@ private function serializeComponents(array $components): string /** * Decode the response content and validate it to make sure it does not have any errors. * - * @param string $url * @param string $content * * @return \Stdclass result form json_decode() @@ -451,8 +437,7 @@ private function validateResponse(string $url, $content) /** * Parse coordinates and bounds. * - * @param AddressBuilder $builder - * @param \Stdclass $result + * @param \Stdclass $result */ private function parseCoordinates(AddressBuilder $builder, $result) { diff --git a/Model/GoogleAddress.php b/Model/GoogleAddress.php index 9579f1d..c53f7b9 100644 --- a/Model/GoogleAddress.php +++ b/Model/GoogleAddress.php @@ -122,8 +122,6 @@ final class GoogleAddress extends Address private $partialMatch; /** - * @param string|null $id - * * @return GoogleAddress */ public function withId(string $id = null) @@ -145,8 +143,6 @@ public function getId() } /** - * @param string|null $locationType - * * @return GoogleAddress */ public function withLocationType(string $locationType = null) @@ -165,17 +161,12 @@ public function getLocationType() return $this->locationType; } - /** - * @return array - */ public function getResultType(): array { return $this->resultType; } /** - * @param array $resultType - * * @return GoogleAddress */ public function withResultType(array $resultType) @@ -195,8 +186,6 @@ public function getFormattedAddress() } /** - * @param string|null $formattedAddress - * * @return GoogleAddress */ public function withFormattedAddress(string $formattedAddress = null) @@ -216,8 +205,6 @@ public function getAirport() } /** - * @param string|null $airport - * * @return GoogleAddress */ public function withAirport(string $airport = null) @@ -237,8 +224,6 @@ public function getColloquialArea() } /** - * @param string|null $colloquialArea - * * @return GoogleAddress */ public function withColloquialArea(string $colloquialArea = null) @@ -258,8 +243,6 @@ public function getIntersection() } /** - * @param string|null $intersection - * * @return GoogleAddress */ public function withIntersection(string $intersection = null) @@ -279,8 +262,6 @@ public function getPostalCodeSuffix() } /** - * @param string|null $postalCodeSuffix - * * @return GoogleAddress */ public function withPostalCodeSuffix(string $postalCodeSuffix = null) @@ -300,8 +281,6 @@ public function getNaturalFeature() } /** - * @param string|null $naturalFeature - * * @return GoogleAddress */ public function withNaturalFeature(string $naturalFeature = null) @@ -321,8 +300,6 @@ public function getNeighborhood() } /** - * @param string|null $neighborhood - * * @return GoogleAddress */ public function withNeighborhood(string $neighborhood = null) @@ -342,8 +319,6 @@ public function getPark() } /** - * @param string|null $park - * * @return GoogleAddress */ public function withPark(string $park = null) @@ -363,8 +338,6 @@ public function getPointOfInterest() } /** - * @param string|null $pointOfInterest - * * @return GoogleAddress */ public function withPointOfInterest(string $pointOfInterest = null) @@ -384,8 +357,6 @@ public function getPolitical() } /** - * @param string|null $political - * * @return GoogleAddress */ public function withPolitical(string $political = null) @@ -426,8 +397,6 @@ public function getStreetAddress() } /** - * @param string|null $streetAddress - * * @return GoogleAddress */ public function withStreetAddress(string $streetAddress = null) @@ -447,8 +416,6 @@ public function getSubpremise() } /** - * @param string|null $subpremise - * * @return GoogleAddress */ public function withSubpremise(string $subpremise = null) @@ -468,8 +435,6 @@ public function getWard() } /** - * @param string|null $ward - * * @return GoogleAddress */ public function withWard(string $ward = null) @@ -489,8 +454,6 @@ public function getEstablishment() } /** - * @param string|null $establishment - * * @return GoogleAddress */ public function withEstablishment(string $establishment = null) @@ -510,8 +473,6 @@ public function getSubLocalityLevels() } /** - * @param array $subLocalityLevel - * * @return $this */ public function withSubLocalityLevels(array $subLocalityLevel) @@ -552,8 +513,6 @@ public function isPartialMatch() } /** - * @param bool $partialMatch - * * @return $this */ public function withPartialMatch(bool $partialMatch) diff --git a/Tests/GoogleMapsTest.php b/Tests/GoogleMapsTest.php index 9d62915..df03ded 100644 --- a/Tests/GoogleMapsTest.php +++ b/Tests/GoogleMapsTest.php @@ -16,10 +16,10 @@ use Geocoder\IntegrationTest\BaseTestCase; use Geocoder\Model\Address; use Geocoder\Model\AddressCollection; +use Geocoder\Provider\GoogleMaps\GoogleMaps; use Geocoder\Provider\GoogleMaps\Model\GoogleAddress; use Geocoder\Query\GeocodeQuery; use Geocoder\Query\ReverseQuery; -use Geocoder\Provider\GoogleMaps\GoogleMaps; use Psr\Http\Message\RequestInterface; class GoogleMapsTest extends BaseTestCase