geocoder-php / Geocoder

The most featured Geocoder library written in PHP.
https://geocoder-php.org
MIT License
3.95k stars 516 forks source link

GeoIP2 broken #1092

Closed rtiagom closed 3 years ago

rtiagom commented 3 years ago

The GeoIP2 example is broken.

https://github.com/geocoder-php/geoip2-provider

//Use a Maxmind GeoIP2 Database: $reader = new \GeoIp2\Database\Reader('/path/to/geolite2.mmdb');

$adapter = new \Geocoder\Provider\GeoIP2\GeoIP2Adapter($reader); $geocoder = new \Geocoder\Provider\GeoIP2\GeoIP2($adapter);

$address = $geocoder->geocode('74.200.247.59')->first();

Call to undefined method Geocoder\Provider\GeoIP2\GeoIP2::geocode()

Based on the available methods in $geocoder, it should be this: $geocoder->geocodeQuery(GeocodeQuery::create('74.200.247.59'))->first();

jbelien commented 3 years ago

Hello @rtiagom ,

Thanks for the notice. The README file of our GeoIP2 provider is indeed outdated.

Could you submit a PR to update it ? Here is the file to update: https://github.com/geocoder-php/Geocoder/blob/master/src/Provider/GeoIP2/README.md

rtiagom commented 3 years ago

@jbelien will do