src/Service/Direction/DirectionService.php 1 location
|
@@ 57-70 (lines=14) @@
|
| 54 |
|
* |
| 55 |
|
* @return DirectionResponse |
| 56 |
|
*/ |
| 57 |
|
public function route(DirectionRequestInterface $request) |
| 58 |
|
{ |
| 59 |
|
$response = $this->getClient()->sendRequest($this->createRequest($request->build())); |
| 60 |
|
$data = $this->parse((string) $response->getBody(), [ |
| 61 |
|
'pluralization_rules' => [ |
| 62 |
|
'leg' => 'legs', |
| 63 |
|
'route' => 'routes', |
| 64 |
|
'step' => 'steps', |
| 65 |
|
'waypoint_index' => 'waypoint_order', |
| 66 |
|
], |
| 67 |
|
]); |
| 68 |
|
|
| 69 |
|
return $this->buildResponse($data); |
| 70 |
|
} |
| 71 |
|
|
| 72 |
|
/** |
| 73 |
|
* @param mixed[] $data |
src/Service/DistanceMatrix/DistanceMatrixService.php 1 location
|
@@ 46-59 (lines=14) @@
|
| 43 |
|
* |
| 44 |
|
* @return DistanceMatrixResponse |
| 45 |
|
*/ |
| 46 |
|
public function process(DistanceMatrixRequestInterface $request) |
| 47 |
|
{ |
| 48 |
|
$response = $this->getClient()->sendRequest($this->createRequest($request->build())); |
| 49 |
|
$data = $this->parse((string) $response->getBody(), [ |
| 50 |
|
'pluralization_rules' => [ |
| 51 |
|
'destination_address' => 'destination_addresses', |
| 52 |
|
'element' => 'elements', |
| 53 |
|
'origin_address' => 'origin_addresses', |
| 54 |
|
'row' => 'rows', |
| 55 |
|
], |
| 56 |
|
]); |
| 57 |
|
|
| 58 |
|
return $this->buildResponse($data); |
| 59 |
|
} |
| 60 |
|
|
| 61 |
|
/** |
| 62 |
|
* @param mixed[] $data |
src/Service/Geocoder/GeocoderService.php 1 location
|
@@ 46-58 (lines=13) @@
|
| 43 |
|
* |
| 44 |
|
* @return GeocoderResponse |
| 45 |
|
*/ |
| 46 |
|
public function geocode(GeocoderRequestInterface $request) |
| 47 |
|
{ |
| 48 |
|
$response = $this->getClient()->sendRequest($this->createRequest($request->build())); |
| 49 |
|
$data = $this->parse((string) $response->getBody(), [ |
| 50 |
|
'pluralization_rules' => [ |
| 51 |
|
'address_component' => 'address_components', |
| 52 |
|
'type' => 'types', |
| 53 |
|
'result' => 'results', |
| 54 |
|
], |
| 55 |
|
]); |
| 56 |
|
|
| 57 |
|
return $this->buildResponse($data); |
| 58 |
|
} |
| 59 |
|
|
| 60 |
|
/** |
| 61 |
|
* @param mixed[] $data |