geocoder-php / Geocoder

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

Fatal error: Uncaught Error: Class #760

Closed thatryan closed 7 years ago

thatryan commented 7 years ago

Got it all installed finally, thank you guys :)

Attempting to walk through your README steps, https://github.com/geocoder-php/Geocoder#usage

And got the error,

Fatal error: Uncaught Error: Class 'Geocoder\Provider\GoogleMaps' not found

Google led me to issue 684

But I have version 4.0 so I am not sure that applies correct?

My code is verbatim as the README,

$address = get_theme_mod('s_core_business_address');
$adapter  = new \Http\Adapter\Guzzle6\Client();
$provider = new \Geocoder\Provider\GoogleMaps($adapter);
$geocoder = new \Geocoder\StatefulGeocoder($provider, 'en');
Nyholm commented 7 years ago

That's a typo in the readme. Try Geocoder\Provider\GoogleMaps\GoogleMaps

//Tobias Nyholm

On 1 Aug 2017, at 22:18, Ryan Olson notifications@github.com wrote:

Geocoder\Provider\GoogleMaps

thatryan commented 7 years ago

Got it, thank you again.

thatryan commented 7 years ago

Same issue with

$result = $geocoder->geocodeQuery(GeocodeQuery::create($address));

"Fatal error: Uncaught Error: Class 'GeocodeQuery' not found "

Nyholm commented 7 years ago

I've added #761.

Nyholm commented 7 years ago

Again, thank you for this issue.

I've updated the Readme now. It includes namespaces and use statements. Please ping me if you are finding more issues.