Skip to content

Commit 729fe9e

Browse files
committed
Address review: keep existing tests and endpoint constant names
- Restore the pre-existing tests; only change them where v6 requires it (each change is annotated with the reason): * v6 has no poi/poi.landmark types: dropped from testGeocodePlaceWithLocale * v6 dataset differences: Princes Risborough for 'princ', 12 (not 8) Avenue Gambetta for the reverse test, v6 mapbox_id values * v6 treats '&' as the intersection search connector, so the '116th St & Broadway' query no longer matches any address; the test now uses '1600 Pennsylvania Avenue NW, Washington, DC 20500' * v6 removed the fuzzyMatch parameter: the two fuzzy tests are now autocomplete tests - Keep the GEOCODE_ENDPOINT_URL_SSL and REVERSE_ENDPOINT_URL_SSL constant names; only the URL values move to the v6 endpoints. The provider keeps its previous structure, including the constructor signature (the mapbox.places-permanent mode maps to the v6 permanent parameter) - Simplify the CHANGELOG entry to match the style of the previous tags - Keep the v6 fixtures for both MapboxTest and the shared IntegrationTest
1 parent 1b1b0ab commit 729fe9e

4 files changed

Lines changed: 403 additions & 476 deletions

File tree

‎src/Provider/Mapbox/CHANGELOG.md‎

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,20 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee
77
### Added
88

99
- Support for the Mapbox Geocoding API v6 (`/search/geocode/v6/forward` and `/search/geocode/v6/reverse`)
10-
- v6 Structured Input: forward queries built from typed address fields via query data — `address_line1`, `address_number`, `street`, `block`, `place`, `region`, `postcode`, `locality`, `neighborhood`. When any of these is present, the query text is not sent.
11-
- `Mapbox::TYPE_STREET` (new v6 type, added to `Mapbox::TYPES`)
12-
- `Mapbox::TYPE_BLOCK` (Japan) and `Mapbox::TYPE_SECONDARY_ADDRESS` (US) constants (not part of `TYPES`: the API only accepts them in the corresponding regional context)
13-
- `Mapbox::STRUCTURED_INPUT_FIELDS` constant
14-
- Query data support: `autocomplete` (replaces `fuzzy_match`), `proximity` (`"lon,lat"` or `"ip"`), `worldview`
15-
- New 4th constructor argument `bool $permanent` (v6 `permanent=true` result storage)
16-
- `MapboxAddress::getMatchCode()` / `withMatchCode()` — v6 Smart Address Match object
17-
- `MapboxAddress::getMatchConfidence()` / `withMatchConfidence()` — `exact`, `high`, `medium` or `low`
18-
- `MapboxAddress::getAccuracy()` / `withAccuracy()` — `rooftop`, `parcel`, `point`, `interpolated`, `approximate` or `intersection`
10+
- Support for the v6 `autocomplete` parameter and the v6 Structured Input fields
11+
- `Mapbox::TYPE_STREET` and `Mapbox::STRUCTURED_INPUT_FIELDS` constants
12+
- `MapboxAddress::getMatchCode()`, `getMatchConfidence()` and `getAccuracy()` for the v6 response data
1913

2014
### Removed
2115

22-
- Support for the Mapbox Geocoding API v5 (`/geocoding/v5/...`) — pin to `geocoder-php/mapbox-provider:^1.5` to stay on v5
23-
- `Mapbox::GEOCODE_ENDPOINT_URL_SSL` and `Mapbox::REVERSE_ENDPOINT_URL_SSL` constants (replaced by `Mapbox::FORWARD_ENDPOINT_URL` / `Mapbox::REVERSE_ENDPOINT_URL`)
24-
- `Mapbox::GEOCODING_MODE_PLACES`, `Mapbox::GEOCODING_MODE_PLACES_PERMANENT` and `Mapbox::GEOCODING_MODES` constants (v6 has no geocoding modes; use the `permanent` constructor argument)
25-
- `Mapbox::TYPE_POI` and `Mapbox::TYPE_POI_LANDMARK` constants (v6 does not geocode POIs; passing them as `location_type` now yields a 422 error from the API)
26-
- `fuzzy_match` query data (v6 has no fuzzy/typo matching; use `autocomplete` for prefix-style matching)
16+
- Support for the Mapbox Geocoding API v5 (pin to `^1.5` to keep using it)
17+
- Support for the v5 `fuzzy_match` parameter (use `autocomplete` instead)
18+
- `Mapbox::TYPE_POI` and `Mapbox::TYPE_POI_LANDMARK` constants (not available in v6)
2719

2820
### Changed
2921

30-
- The 4th constructor argument is now `bool $permanent = false` (was `string $geocodingMode`); passing a mode string changes behavior or errors
31-
- `Mapbox::TYPES` no longer contains the POI types and now contains `street`
32-
- Forward requests send the search text as the `q` query parameter instead of in the URL path
33-
- Reverse requests send `longitude` / `latitude` query parameters (was `{lon},{lat}` in the path)
34-
- `MapboxAddress::getId()` returns the v6 `mapbox_id` value (format changed, e.g. `dXJu...` instead of `address.123`)
35-
- `MapboxAddress::getResultType()` values follow the v6 `feature_type` vocabulary (`street` added, `poi`/`poi.landmark` gone)
36-
- Reverse geocoding with a `limit` greater than 1 requires a single `location_type` value (v6 API constraint: multiple types + limit returns a 422 error)
37-
- Forward `limit` is capped at 10 by the v6 API (higher values are silently clamped)
38-
- Invalid access tokens are now answered with HTTP 401 by the API (v5 used 403); both map to `Geocoder\Exception\InvalidCredentials`
39-
- Geocoded data reflects the v6 dataset: coordinates, results and admin-level codes may differ from v5
22+
- The `mapbox.places-permanent` mode is now sent as the v6 `permanent` parameter
23+
- Results carry the v6 `mapbox_id` format and v6 dataset values
4024

4125
## 1.5.0
4226

0 commit comments

Comments
 (0)