1212
1313namespace Geocoder \Provider \IpInfoDb ;
1414
15+ use Geocoder \Collection ;
1516use Geocoder \Exception \InvalidArgument ;
1617use Geocoder \Exception \InvalidCredentials ;
1718use Geocoder \Exception \UnsupportedOperation ;
18- use Geocoder \Collection ;
19+ use Geocoder \Http \ Provider \ AbstractHttpProvider ;
1920use Geocoder \Model \Address ;
2021use Geocoder \Model \AddressCollection ;
22+ use Geocoder \Provider \Provider ;
2123use Geocoder \Query \GeocodeQuery ;
2224use Geocoder \Query \ReverseQuery ;
23- use Geocoder \Http \Provider \AbstractHttpProvider ;
24- use Geocoder \Provider \Provider ;
2525use Psr \Http \Client \ClientInterface ;
2626
2727/**
@@ -32,12 +32,12 @@ final class IpInfoDb extends AbstractHttpProvider implements Provider
3232 /**
3333 * @var string
3434 */
35- const CITY_PRECISION_ENDPOINT_URL = 'https://api.ipinfodb.com/v3/ip-city/?key=%s&format=json&ip=%s ' ;
35+ public const CITY_PRECISION_ENDPOINT_URL = 'https://api.ipinfodb.com/v3/ip-city/?key=%s&format=json&ip=%s ' ;
3636
3737 /**
3838 * @var string
3939 */
40- const COUNTRY_PRECISION_ENDPOINT_URL = 'https://api.ipinfodb.com/v3/ip-country/?key=%s&format=json&ip=%s ' ;
40+ public const COUNTRY_PRECISION_ENDPOINT_URL = 'https://api.ipinfodb.com/v3/ip-country/?key=%s&format=json&ip=%s ' ;
4141
4242 /**
4343 * @var string
@@ -77,9 +77,6 @@ public function __construct(ClientInterface $client, string $apiKey, string $pre
7777 }
7878 }
7979
80- /**
81- * {@inheritdoc}
82- */
8380 public function geocodeQuery (GeocodeQuery $ query ): Collection
8481 {
8582 $ address = $ query ->getText ();
@@ -105,25 +102,16 @@ public function geocodeQuery(GeocodeQuery $query): Collection
105102 return $ this ->executeQuery ($ url );
106103 }
107104
108- /**
109- * {@inheritdoc}
110- */
111105 public function reverseQuery (ReverseQuery $ query ): Collection
112106 {
113107 throw new UnsupportedOperation ('The IpInfoDb provider is not able to do reverse geocoding. ' );
114108 }
115109
116- /**
117- * {@inheritdoc}
118- */
119110 public function getName (): string
120111 {
121112 return 'ip_info_db ' ;
122113 }
123114
124- /**
125- * @param string $url
126- */
127115 private function executeQuery (string $ url ): AddressCollection
128116 {
129117 $ content = $ this ->getUrlContents ($ url );
0 commit comments