1515use Geocoder \Collection ;
1616use Geocoder \Exception \InvalidServerResponse ;
1717use Geocoder \Exception \UnsupportedOperation ;
18+ use Geocoder \Http \Provider \AbstractHttpProvider ;
1819use Geocoder \Model \Address ;
1920use Geocoder \Model \AddressCollection ;
21+ use Geocoder \Provider \Provider ;
2022use Geocoder \Query \GeocodeQuery ;
2123use Geocoder \Query \ReverseQuery ;
22- use Geocoder \Http \Provider \AbstractHttpProvider ;
23- use Geocoder \Provider \Provider ;
2424
2525/**
2626 * @author Andrea Cristaudo <[email protected] > @@ -30,11 +30,8 @@ final class GeoPlugin extends AbstractHttpProvider implements Provider
3030 /**
3131 * @var string
3232 */
33- const GEOCODE_ENDPOINT_URL = 'http://www.geoplugin.net/json.gp?ip=%s ' ;
33+ public const GEOCODE_ENDPOINT_URL = 'http://www.geoplugin.net/json.gp?ip=%s ' ;
3434
35- /**
36- * {@inheritdoc}
37- */
3835 public function geocodeQuery (GeocodeQuery $ query ): Collection
3936 {
4037 $ address = $ query ->getText ();
@@ -51,27 +48,16 @@ public function geocodeQuery(GeocodeQuery $query): Collection
5148 return $ this ->executeQuery ($ url );
5249 }
5350
54- /**
55- * {@inheritdoc}
56- */
5751 public function reverseQuery (ReverseQuery $ query ): Collection
5852 {
5953 throw new UnsupportedOperation ('The GeoPlugin provider is not able to do reverse geocoding. ' );
6054 }
6155
62- /**
63- * {@inheritdoc}
64- */
6556 public function getName (): string
6657 {
6758 return 'geo_plugin ' ;
6859 }
6960
70- /**
71- * @param string $url
72- *
73- * @return AddressCollection
74- */
7561 private function executeQuery (string $ url ): AddressCollection
7662 {
7763 $ content = $ this ->getUrlContents ($ url );
0 commit comments