src/Service/Direction/DirectionService.php 1 location
|
@@ 57-75 (lines=19) @@
|
| 54 |
|
* |
| 55 |
|
* @return DirectionResponse |
| 56 |
|
*/ |
| 57 |
|
public function route(DirectionRequestInterface $request) |
| 58 |
|
{ |
| 59 |
|
$httpRequest = $this->createRequest($request); |
| 60 |
|
$httpResponse = $this->getClient()->sendRequest($httpRequest); |
| 61 |
|
|
| 62 |
|
$data = $this->parse((string) $httpResponse->getBody(), [ |
| 63 |
|
'pluralization_rules' => [ |
| 64 |
|
'leg' => 'legs', |
| 65 |
|
'route' => 'routes', |
| 66 |
|
'step' => 'steps', |
| 67 |
|
'waypoint_index' => 'waypoint_order', |
| 68 |
|
], |
| 69 |
|
]); |
| 70 |
|
|
| 71 |
|
$response = $this->buildResponse($data); |
| 72 |
|
$response->setRequest($request); |
| 73 |
|
|
| 74 |
|
return $response; |
| 75 |
|
} |
| 76 |
|
|
| 77 |
|
/** |
| 78 |
|
* @param mixed[] $data |
src/Service/DistanceMatrix/DistanceMatrixService.php 1 location
|
@@ 46-64 (lines=19) @@
|
| 43 |
|
* |
| 44 |
|
* @return DistanceMatrixResponse |
| 45 |
|
*/ |
| 46 |
|
public function process(DistanceMatrixRequestInterface $request) |
| 47 |
|
{ |
| 48 |
|
$httpRequest = $this->createRequest($request); |
| 49 |
|
$httpResponse = $this->getClient()->sendRequest($httpRequest); |
| 50 |
|
|
| 51 |
|
$data = $this->parse((string) $httpResponse->getBody(), [ |
| 52 |
|
'pluralization_rules' => [ |
| 53 |
|
'destination_address' => 'destination_addresses', |
| 54 |
|
'element' => 'elements', |
| 55 |
|
'origin_address' => 'origin_addresses', |
| 56 |
|
'row' => 'rows', |
| 57 |
|
], |
| 58 |
|
]); |
| 59 |
|
|
| 60 |
|
$response = $this->buildResponse($data); |
| 61 |
|
$response->setRequest($request); |
| 62 |
|
|
| 63 |
|
return $response; |
| 64 |
|
} |
| 65 |
|
|
| 66 |
|
/** |
| 67 |
|
* @param mixed[] $data |
src/Service/Geocoder/GeocoderService.php 1 location
|
@@ 46-63 (lines=18) @@
|
| 43 |
|
* |
| 44 |
|
* @return GeocoderResponse |
| 45 |
|
*/ |
| 46 |
|
public function geocode(GeocoderRequestInterface $request) |
| 47 |
|
{ |
| 48 |
|
$httpRequest = $this->createRequest($request); |
| 49 |
|
$httpResponse = $this->getClient()->sendRequest($httpRequest); |
| 50 |
|
|
| 51 |
|
$data = $this->parse((string) $httpResponse->getBody(), [ |
| 52 |
|
'pluralization_rules' => [ |
| 53 |
|
'address_component' => 'address_components', |
| 54 |
|
'type' => 'types', |
| 55 |
|
'result' => 'results', |
| 56 |
|
], |
| 57 |
|
]); |
| 58 |
|
|
| 59 |
|
$response = $this->buildResponse($data); |
| 60 |
|
$response->setRequest($request); |
| 61 |
|
|
| 62 |
|
return $response; |
| 63 |
|
} |
| 64 |
|
|
| 65 |
|
/** |
| 66 |
|
* @param mixed[] $data |
src/Service/Place/Autocomplete/PlaceAutocompleteService.php 1 location
|
@@ 43-61 (lines=19) @@
|
| 40 |
|
* |
| 41 |
|
* @return PlaceAutocompleteResponse |
| 42 |
|
*/ |
| 43 |
|
public function process(PlaceAutocompleteRequestInterface $request) |
| 44 |
|
{ |
| 45 |
|
$httpRequest = $this->createRequest($request); |
| 46 |
|
$httpResponse = $this->getClient()->sendRequest($httpRequest); |
| 47 |
|
|
| 48 |
|
$data = $this->parse((string) $httpResponse->getBody(), [ |
| 49 |
|
'pluralization_rules' => [ |
| 50 |
|
'matched_substring' => 'matched_substrings', |
| 51 |
|
'prediction' => 'predictions', |
| 52 |
|
'term' => 'terms', |
| 53 |
|
'type' => 'types', |
| 54 |
|
], |
| 55 |
|
]); |
| 56 |
|
|
| 57 |
|
$response = $this->buildResponse($data); |
| 58 |
|
$response->setRequest($request); |
| 59 |
|
|
| 60 |
|
return $response; |
| 61 |
|
} |
| 62 |
|
|
| 63 |
|
/** |
| 64 |
|
* @param mixed[] $data |
src/Service/Place/Search/PlaceSearchService.php 1 location
|
@@ 47-65 (lines=19) @@
|
| 44 |
|
* |
| 45 |
|
* @return PlaceSearchResponseIterator |
| 46 |
|
*/ |
| 47 |
|
public function process(PlaceSearchRequestInterface $request) |
| 48 |
|
{ |
| 49 |
|
$httpRequest = $this->createRequest($request); |
| 50 |
|
$httpResponse = $this->getClient()->sendRequest($httpRequest); |
| 51 |
|
|
| 52 |
|
$data = $this->parse((string) $httpResponse->getBody(), [ |
| 53 |
|
'pluralization_rules' => [ |
| 54 |
|
'html_attribution' => 'html_attributions', |
| 55 |
|
'photo' => 'photos', |
| 56 |
|
'result' => 'results', |
| 57 |
|
'type' => 'types', |
| 58 |
|
], |
| 59 |
|
]); |
| 60 |
|
|
| 61 |
|
$response = $this->buildResponse($data); |
| 62 |
|
$response->setRequest($request); |
| 63 |
|
|
| 64 |
|
return new PlaceSearchResponseIterator($this, $response); |
| 65 |
|
} |
| 66 |
|
|
| 67 |
|
/** |
| 68 |
|
* @param mixed[] $data |