@@ -28,10 +28,10 @@ |
||
| 28 | 28 | $route->parameters = new \stdClass(); |
| 29 | 29 | |
| 30 | 30 | $route->parameters = [ |
| 31 | - 'member_id' => $randomRoute->member_id, |
|
| 32 | - 'optimize' => 'Distance', |
|
| 33 | - 'route_max_duration' => '82400', |
|
| 34 | - 'route_name' => 'updated '.date('m-d-Y'), |
|
| 31 | + 'member_id' => $randomRoute->member_id, |
|
| 32 | + 'optimize' => 'Distance', |
|
| 33 | + 'route_max_duration' => '82400', |
|
| 34 | + 'route_name' => 'updated '.date('m-d-Y'), |
|
| 35 | 35 | ]; |
| 36 | 36 | |
| 37 | 37 | $route->httpheaders = 'Content-type: application/json'; |
@@ -38,4 +38,4 @@ |
||
| 38 | 38 | |
| 39 | 39 | $result = $route->update(); |
| 40 | 40 | |
| 41 | -Route4Me::simplePrint((array) $result->parameters); |
|
| 41 | +Route4Me::simplePrint((array)$result->parameters); |
|
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | $route->parameters = new \stdClass(); |
| 41 | 41 | |
| 42 | 42 | $route->parameters = [ |
| 43 | - 'member_id' => $randomUserID, |
|
| 43 | + 'member_id' => $randomUserID, |
|
| 44 | 44 | ]; |
| 45 | 45 | |
| 46 | 46 | $route->httpheaders = 'Content-type: application/json'; |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | $users = $member->getUsers(); |
| 19 | 19 | |
| 20 | 20 | assert(!is_null($users), 'Cannot retrieve list of the users'); |
| 21 | -assert(2 == sizeof($users), 'Cannot retrieve list of the users'); |
|
| 21 | +assert(2==sizeof($users), 'Cannot retrieve list of the users'); |
|
| 22 | 22 | assert(isset($users['results']), 'Cannot retrieve list of the users'); |
| 23 | 23 | assert(isset($users['total']), 'Cannot retrieve list of the users'); |
| 24 | 24 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $route = new Route(); |
| 51 | 51 | |
| 52 | -$assignedRoute= $route->getRoutes(['route_id' => $routeId]); |
|
| 52 | +$assignedRoute = $route->getRoutes(['route_id' => $routeId]); |
|
| 53 | 53 | |
| 54 | 54 | echo "Assigned member id -> ".$assignedRoute->parameters->{'member_id'}; |
| 55 | 55 | |
@@ -19,9 +19,9 @@ |
||
| 19 | 19 | |
| 20 | 20 | // Share a route with an email |
| 21 | 21 | $params = [ |
| 22 | - 'route_id' => $route_id, |
|
| 23 | - 'response_format' => 'json', |
|
| 24 | - 'recipient_email' => '[email protected]', |
|
| 22 | + 'route_id' => $route_id, |
|
| 23 | + 'response_format' => 'json', |
|
| 24 | + 'recipient_email' => '[email protected]', |
|
| 25 | 25 | ]; |
| 26 | 26 | |
| 27 | 27 | $result = $route->shareRoute($params); |
@@ -16,9 +16,9 @@ discard block |
||
| 16 | 16 | $vehicle = new Vehicles\Vehicle(); |
| 17 | 17 | |
| 18 | 18 | $vehicleParameters = [ |
| 19 | - 'with_pagination' => true, |
|
| 20 | - 'page' => 1, |
|
| 21 | - 'perPage' => 10, |
|
| 19 | + 'with_pagination' => true, |
|
| 20 | + 'page' => 1, |
|
| 21 | + 'perPage' => 10, |
|
| 22 | 22 | ]; |
| 23 | 23 | |
| 24 | 24 | $response = $vehicle->getVehicles($vehicleParameters); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $route->parameters = new \stdClass(); |
| 41 | 41 | |
| 42 | 42 | $route->parameters = [ |
| 43 | - 'vehicle_id' => $vehicleId, |
|
| 43 | + 'vehicle_id' => $vehicleId, |
|
| 44 | 44 | ]; |
| 45 | 45 | |
| 46 | 46 | $route->httpheaders = 'Content-type: application/json'; |
@@ -49,6 +49,6 @@ |
||
| 49 | 49 | |
| 50 | 50 | $route = new Route(); |
| 51 | 51 | |
| 52 | -$assignedRoute= $route->getRoutes(['route_id' => $routeId]); |
|
| 52 | +$assignedRoute = $route->getRoutes(['route_id' => $routeId]); |
|
| 53 | 53 | |
| 54 | 54 | Route4Me::simplePrint((array)$assignedRoute->vehicle, true); |
@@ -9,8 +9,8 @@ discard block |
||
| 9 | 9 | Route4Me::setApiKey(Constants::API_KEY); |
| 10 | 10 | |
| 11 | 11 | $RouteParameters = [ |
| 12 | - 'start_date' => '2019-08-01', |
|
| 13 | - 'end_date' => '2019-08-05' |
|
| 12 | + 'start_date' => '2019-08-01', |
|
| 13 | + 'end_date' => '2019-08-05' |
|
| 14 | 14 | ]; |
| 15 | 15 | |
| 16 | 16 | $route = new Route(); |
@@ -18,9 +18,9 @@ discard block |
||
| 18 | 18 | $routeResults = $route->getRoutes($RouteParameters); |
| 19 | 19 | |
| 20 | 20 | foreach ($routeResults as $routeResult) { |
| 21 | - $results = (array) $routeResult; |
|
| 21 | + $results = (array) $routeResult; |
|
| 22 | 22 | |
| 23 | - Route4Me::simplePrint($results); |
|
| 23 | + Route4Me::simplePrint($results); |
|
| 24 | 24 | |
| 25 | - echo '<br>'; |
|
| 25 | + echo '<br>'; |
|
| 26 | 26 | } |
| 27 | 27 | \ No newline at end of file |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | $routeResults = $route->getRoutes($RouteParameters); |
| 19 | 19 | |
| 20 | 20 | foreach ($routeResults as $routeResult) { |
| 21 | - $results = (array) $routeResult; |
|
| 21 | + $results = (array)$routeResult; |
|
| 22 | 22 | |
| 23 | 23 | Route4Me::simplePrint($results); |
| 24 | 24 | |
@@ -18,14 +18,14 @@ |
||
| 18 | 18 | assert(!is_null($route_id), "Cannot retrieve a random route ID"); |
| 19 | 19 | |
| 20 | 20 | $params = [ |
| 21 | - 'route_id' => $route_id, |
|
| 21 | + 'route_id' => $route_id, |
|
| 22 | 22 | ]; |
| 23 | 23 | |
| 24 | 24 | $status = $route->resequenceAllAddresses($params); |
| 25 | 25 | |
| 26 | 26 | $params = [ |
| 27 | - 'route_id' => $route_id, |
|
| 28 | - 'original' => 1 |
|
| 27 | + 'route_id' => $route_id, |
|
| 28 | + 'original' => 1 |
|
| 29 | 29 | ]; |
| 30 | 30 | |
| 31 | 31 | $routeWithOriginRoute = $route->getRoutes($params); |
@@ -9,8 +9,8 @@ discard block |
||
| 9 | 9 | Route4Me::setApiKey(Constants::API_KEY); |
| 10 | 10 | |
| 11 | 11 | $RouteParameters = [ |
| 12 | - 'limit' => 30, |
|
| 13 | - 'offset' => 0, |
|
| 12 | + 'limit' => 30, |
|
| 13 | + 'offset' => 0, |
|
| 14 | 14 | ]; |
| 15 | 15 | |
| 16 | 16 | $route = new Route(); |
@@ -18,9 +18,9 @@ discard block |
||
| 18 | 18 | $routeResults = $route->getRoutes($RouteParameters); |
| 19 | 19 | |
| 20 | 20 | foreach ($routeResults as $routeResult) { |
| 21 | - $results = (array) $routeResult; |
|
| 21 | + $results = (array) $routeResult; |
|
| 22 | 22 | |
| 23 | - Route4Me::simplePrint($results); |
|
| 23 | + Route4Me::simplePrint($results); |
|
| 24 | 24 | |
| 25 | - echo '<br>'; |
|
| 25 | + echo '<br>'; |
|
| 26 | 26 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | $routeResults = $route->getRoutes($RouteParameters); |
| 19 | 19 | |
| 20 | 20 | foreach ($routeResults as $routeResult) { |
| 21 | - $results = (array) $routeResult; |
|
| 21 | + $results = (array)$routeResult; |
|
| 22 | 22 | |
| 23 | 23 | Route4Me::simplePrint($results); |
| 24 | 24 | |
@@ -21,26 +21,26 @@ |
||
| 21 | 21 | |
| 22 | 22 | // Get a route with the path points |
| 23 | 23 | $params = [ |
| 24 | - 'route_path_output' => 'Points', |
|
| 25 | - 'compress_path_points' => true, |
|
| 26 | - 'route_id' => $route_id, |
|
| 24 | + 'route_path_output' => 'Points', |
|
| 25 | + 'compress_path_points' => true, |
|
| 26 | + 'route_id' => $route_id, |
|
| 27 | 27 | ]; |
| 28 | 28 | |
| 29 | 29 | $routeResults = (array) $route->getRoutePoints($params); |
| 30 | 30 | |
| 31 | 31 | if (isset($routeResults['addresses'])) { |
| 32 | - foreach ($routeResults['addresses'] as $key => $address) { |
|
| 33 | - $arAddress = (array) $address; |
|
| 32 | + foreach ($routeResults['addresses'] as $key => $address) { |
|
| 33 | + $arAddress = (array) $address; |
|
| 34 | 34 | |
| 35 | - if (isset($araddress['route_destination_id'])) { |
|
| 36 | - echo 'route_destination_id='.$arAddress['route_destination_id'].'<br>'; |
|
| 37 | - } |
|
| 35 | + if (isset($araddress['route_destination_id'])) { |
|
| 36 | + echo 'route_destination_id='.$arAddress['route_destination_id'].'<br>'; |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - if (isset($arAddress['path_to_next'])) { |
|
| 40 | - echo 'path_to_next:<br>'; |
|
| 41 | - Route4Me::simplePrint((array) $arAddress['path_to_next']); |
|
| 42 | - } |
|
| 39 | + if (isset($arAddress['path_to_next'])) { |
|
| 40 | + echo 'path_to_next:<br>'; |
|
| 41 | + Route4Me::simplePrint((array) $arAddress['path_to_next']); |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - echo '<br>'; |
|
| 45 | - } |
|
| 44 | + echo '<br>'; |
|
| 45 | + } |
|
| 46 | 46 | } |
@@ -26,11 +26,11 @@ discard block |
||
| 26 | 26 | 'route_id' => $route_id, |
| 27 | 27 | ]; |
| 28 | 28 | |
| 29 | -$routeResults = (array) $route->getRoutePoints($params); |
|
| 29 | +$routeResults = (array)$route->getRoutePoints($params); |
|
| 30 | 30 | |
| 31 | 31 | if (isset($routeResults['addresses'])) { |
| 32 | 32 | foreach ($routeResults['addresses'] as $key => $address) { |
| 33 | - $arAddress = (array) $address; |
|
| 33 | + $arAddress = (array)$address; |
|
| 34 | 34 | |
| 35 | 35 | if (isset($araddress['route_destination_id'])) { |
| 36 | 36 | echo 'route_destination_id='.$arAddress['route_destination_id'].'<br>'; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | if (isset($arAddress['path_to_next'])) { |
| 40 | 40 | echo 'path_to_next:<br>'; |
| 41 | - Route4Me::simplePrint((array) $arAddress['path_to_next']); |
|
| 41 | + Route4Me::simplePrint((array)$arAddress['path_to_next']); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | echo '<br>'; |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | $route->parameters = new \stdClass(); |
| 29 | 29 | |
| 30 | 30 | $route->parameters = [ |
| 31 | - 'recompute_directions' => 1, |
|
| 31 | + 'recompute_directions' => 1, |
|
| 32 | 32 | ]; |
| 33 | 33 | |
| 34 | 34 | $route->httpheaders = 'Content-type: application/json'; |
@@ -38,4 +38,4 @@ |
||
| 38 | 38 | |
| 39 | 39 | $result = $route->update(); |
| 40 | 40 | |
| 41 | -Route4Me::simplePrint((array) $result->parameters); |
|
| 41 | +Route4Me::simplePrint((array)$result->parameters); |
|