Search code examples
phpfoursquaregoogle-placesyelpcloudrail

Unknown category error


When I use the category property I see this error:

Fatal error: Uncaught CloudRail\Error\IllegalArgumentError: Illegal argument used: Unknown category. in ...\vendor\cloudrail\library-php\src\Service\GooglePlaces.php

Without category all work fine. My code:

$cr_service = load_cloudrail_service('GooglePlaces');
$retrievedPOIs = $cr_service->getNearbyPOIs(50.45594, 30.465612, 40000, '', ['restaurant']);

function load_cloudrail_service($serviceName = 'Foursquare') {
  global $options;

  Settings::$licenseKey = $options['cr_key'];

  switch ($serviceName) {
    case 'Foursquare':
    $result = new Foursquare( $options['fsquare_id'], $options['fsquare_secret'] );
    break;
    case 'Yelp':
    $result = new \CloudRail\Service\Yelp( $options['yelp_key'] );
    break;
    case 'GooglePlaces':
    $result = new GooglePlaces( $options['gplaces_key'] );
    break;
  }
  return $result;
}

The same error with other services. What wrong? Thank you.


Solution

  • Thank you for update to 1.0.2 version. It helped. But when I had tried to update version I have received incorrect version of cloudrail. To avoid this issue just remove composer.lock or use command composer install update to update dependencies in lock file.