Skip to content

Comments

Add HERE Geocoding & Search API (v8) support with v7 compatibility#1265

Open
Giacomo92 wants to merge 7 commits intogeocoder-php:masterfrom
offline-agency:upgrade/here-maps-api-v8
Open

Add HERE Geocoding & Search API (v8) support with v7 compatibility#1265
Giacomo92 wants to merge 7 commits intogeocoder-php:masterfrom
offline-agency:upgrade/here-maps-api-v8

Conversation

@Giacomo92
Copy link

@Giacomo92 Giacomo92 commented Feb 23, 2026

The HERE Geocoder REST API (v7, path /6.2/) was deprecated December 31, 2023 and shut down in
July 2025. This PR adds support for the replacement HERE Geocoding & Search API while preserving backward compatibility with the legacy API during the transition period.

Note on version naming: HERE confusingly named their new API "Geocoding & Search API v7"
(GS7). To avoid collision with the legacy /6.2/ API, this provider uses the shorthand "v8"
for the new API and "v7" for the legacy one.

…lity

Add support for HERE Geocoding and Search API (v8), making it the new
default while preserving full backward compatibility with the legacy
Geocoder REST API (v7, retired December 31, 2023).

- createUsingApiKey() now creates a v8 provider; use createV7UsingApiKey()
  for the deprecated v7 API
- Constructor new Here(client, appId, appCode) still creates a v7 provider
- Version-branching in geocodeQuery/reverseQuery/executeQuery keeps v7 and
  v8 code paths cleanly separated
- parseV8Response() maps the v8 items[] structure to HereAddress
- parseV7Response() extracted from the old inline loop (no logic change)
- v7 endpoint constants and helpers preserved with @deprecated tags
- HereAddress: typed nullable properties and null guards (null safety)
…n selection

- HereTest.php: replace createUsingApiKey() with createV7UsingApiKey() in
  all v7 real-API tests and getProvider() helper, since createUsingApiKey()
  now creates a v8 provider by default
- HereTest.php: add testDefaultVersionIsV8(), testV7ExplicitSelectionViaConstructor(),
  and testCreateV7UsingApiKeyFactory() to verify API version routing
- HereV8Test.php: new test class covering v8 geocode/reverse mapping,
  invalid credentials, no-results, IP address rejection, query param
  pass-through, and all HereAddress field assertions
- IntegrationTest.php: rename createProvider() to use createV7UsingApiKey()
  so existing v7 cached response tests continue to work unchanged
- Add createV8Provider() factory and four new v8 integration tests:
  testGeocodeQueryV8, testGeocodeQueryWithNoResultsV8, testReverseQueryV8,
  testReverseQueryWithNoResultsV8
- Rename CIT tests to testGeocodeQueryCITv7 / testReverseQueryCITv7 to
  clarify they test the v7-only CIT environment
- getApiKey() now falls back to 'missing' (was unguarded array access)
- Add four v8 cached response fixtures (PHP-serialized HERE GS7 API JSON)
Rewrite Readme.md with dual-version documentation:
- Comparison table of v7 (legacy, retired Dec 31 2023) vs v8 (recommended)
- v8 usage with createUsingApiKey() as the primary example
- v8 query parameter reference (at, in, types, qq-mapped fields)
- v8 response field reference (locationId, locationType, additionalData)
- v7 usage examples marked @deprecated with migration warnings
- Step-by-step migration guide from v7 to v8
- Links to HERE migration guide and retirement announcement
Rewrite Readme.md with dual-version documentation:
- Comparison table of v7 (legacy, retired Dec 31 2023) vs v8 (recommended)
- v8 usage with createUsingApiKey() as the primary example
- v8 query parameter reference (at, in, types, qq-mapped fields)
- v8 response field reference (locationId, locationType, additionalData)
- v7 usage examples marked @deprecated with migration warnings
- Step-by-step migration guide from v7 to v8
- Links to HERE migration guide and retirement announcement
…Geocoder into upgrade/here-maps-api-v8

# Conflicts:
#	src/Provider/Here/Readme.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant