Skip to content

v3.0.0

Latest

Choose a tag to compare

@andrepimpao andrepimpao released this 09 Nov 13:13
daa000f

What's Changed

Breaking Changes

Parameter validation for endpoints (like validating the given latitude/longitude before making the request) was removed. This is only relevant if you were catching validation exceptions.

Now the validation is performed by the native API itself and can be "catched" in the already existing API Error Exceptions.

As an alternative, and with its advantages (like adding your own error messages), you can use the programmatordev/fluent-validator (or any other validation library) to do the same:

try {
  Validator::range(-90, 90)->assert($latitude);
  Validator::range(-180, 180)->assert($longitude);

  $weather = $api->weather()->getCurrent($latitude, $longitude);
}
catch (ValidationFailedException $e) {
  // handle validation errors
}
catch (ApiErrorException $e) {
  // handle API errors
}

Full Changelog: v2.0.0...v3.0.0