Skip to content

Commit

Permalink
Upgrade format for the new version 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
maxhelias committed Aug 27, 2018
1 parent b64cce8 commit 7bd5fd7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Nominatim.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function newLookup(): Lookup
*/
private function decodeResponse(string $format, Request $request, ResponseInterface $response)
{
if ('json' === $format) {
if ('json' === $format || 'jsonv2' === $format || 'geojson' === $format || 'geocodejson' === $format) {
return \json_decode($response->getBody()->getContents(), true);
}

Expand All @@ -175,8 +175,8 @@ private function decodeResponse(string $format, Request $request, ResponseInterf
* @param QueryInterface $nRequest The object request to send
* @param array $headers Override the request header
*
* @throws \RuntimeException
* @throws NominatimException if no format for decode
* @throws NominatimException if no format for decode
* @throws \GuzzleHttp\Exception\GuzzleException
*
* @return array|\SimpleXMLElement The decoded data returned from Nominatim
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ abstract class Query implements QueryInterface
*
* @var array
*/
protected $acceptedFormat = ['xml', 'json'];
protected $acceptedFormat = ['xml', 'json', 'jsonv2', 'geojson', 'geocodejson'];

/**
* Output polygon format accepted.
Expand Down

0 comments on commit 7bd5fd7

Please sign in to comment.