@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 5 | 5 | |
| 6 | 6 | require $vdir.'/../vendor/autoload.php'; |
| 7 | 7 | |
@@ -13,23 +13,23 @@ discard block |
||
| 13 | 13 | // Add Avoidance Zone and get territory_id |
| 14 | 14 | //--------------------------------------------------------- |
| 15 | 15 | $territory = new Territory(); |
| 16 | - $territory->type = TerritoryTypes::CIRCLE; |
|
| 17 | - $territory->data = array ( |
|
| 16 | + $territory->type = TerritoryTypes::CIRCLE; |
|
| 17 | + $territory->data = array( |
|
| 18 | 18 | "37.569752822786455,-77.47833251953125", |
| 19 | 19 | "5000" |
| 20 | 20 | ); |
| 21 | 21 | |
| 22 | - $AvoisanceZoneParameters=AvoidanceZone::fromArray(array( |
|
| 23 | - "territory_name" => "Test Territory ".strval(rand(10000,99999)), |
|
| 22 | + $AvoisanceZoneParameters = AvoidanceZone::fromArray(array( |
|
| 23 | + "territory_name" => "Test Territory ".strval(rand(10000, 99999)), |
|
| 24 | 24 | "territory_color" => "ff7700", |
| 25 | 25 | "territory" => $territory |
| 26 | 26 | )); |
| 27 | 27 | |
| 28 | - $avoidancezone=new AvoidanceZone(); |
|
| 28 | + $avoidancezone = new AvoidanceZone(); |
|
| 29 | 29 | |
| 30 | 30 | $result = (array)$avoidancezone->addAvoidanceZone($AvoisanceZoneParameters); |
| 31 | 31 | |
| 32 | - $territory_id=""; |
|
| 32 | + $territory_id = ""; |
|
| 33 | 33 | if (isset($result)) { |
| 34 | 34 | $territory_id = $result["territory_id"]; |
| 35 | 35 | } else { |
@@ -42,13 +42,13 @@ discard block |
||
| 42 | 42 | //----------------------------------------------------------- |
| 43 | 43 | |
| 44 | 44 | $territory = new Territory(); |
| 45 | - $territory->type = TerritoryTypes::RECT; |
|
| 46 | - $territory->data = array ( |
|
| 45 | + $territory->type = TerritoryTypes::RECT; |
|
| 46 | + $territory->data = array( |
|
| 47 | 47 | "37.869752822786455,-77.49833251953125", |
| 48 | 48 | "5000" |
| 49 | 49 | ); |
| 50 | 50 | |
| 51 | - $AvoisanceZoneParameters=AvoidanceZone::fromArray(array( |
|
| 51 | + $AvoisanceZoneParameters = AvoidanceZone::fromArray(array( |
|
| 52 | 52 | "territory_id" => $territory_id, |
| 53 | 53 | "territory_name" => "Test Territory Updated", |
| 54 | 54 | "territory_color" => "ff5500", |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 4 | +$vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 5 | 5 | |
| 6 | 6 | require $vdir.'/../vendor/autoload.php'; |
| 7 | 7 | |
@@ -13,18 +13,18 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | // Get random route from test routes |
| 15 | 15 | //-------------------------------------------------------- |
| 16 | - $route=new Route(); |
|
| 16 | + $route = new Route(); |
|
| 17 | 17 | |
| 18 | - $route_id=$route->getRandomRouteId(10, 20); |
|
| 18 | + $route_id = $route->getRandomRouteId(10, 20); |
|
| 19 | 19 | |
| 20 | 20 | if (is_null($route_id)) { |
| 21 | 21 | echo "can't retrieve random route_id!.. Try again."; |
| 22 | 22 | return; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - $route=$route->getRoutes($route_id,null); |
|
| 25 | + $route = $route->getRoutes($route_id, null); |
|
| 26 | 26 | |
| 27 | - $optimizationProblemId=$route->getOptimizationId(); |
|
| 27 | + $optimizationProblemId = $route->getOptimizationId(); |
|
| 28 | 28 | |
| 29 | 29 | $problemParams = array( |
| 30 | 30 | 'optimization_problem_id' => $optimizationProblemId |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 5 | 5 | |
| 6 | 6 | require $vdir.'/../vendor/autoload.php'; |
| 7 | 7 | |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | //-------------------------------------------------------- |
| 17 | 17 | $optimization = new OptimizationProblem(); |
| 18 | 18 | |
| 19 | - $params = array ( |
|
| 19 | + $params = array( |
|
| 20 | 20 | "optimization_problem_ids" => array( |
| 21 | 21 | "0" => "E222162732CBC3BF9A79F90D83E12DFC" |
| 22 | 22 | ), |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 5 | 5 | |
| 6 | 6 | require $vdir.'/../vendor/autoload.php'; |
| 7 | 7 | |
@@ -13,18 +13,18 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | // Get random route from test routes |
| 15 | 15 | //-------------------------------------------------------- |
| 16 | - $route=new Route(); |
|
| 16 | + $route = new Route(); |
|
| 17 | 17 | |
| 18 | - $route_id=$route->getRandomRouteId(10, 20); |
|
| 18 | + $route_id = $route->getRandomRouteId(10, 20); |
|
| 19 | 19 | |
| 20 | 20 | if (is_null($route_id)) { |
| 21 | 21 | echo "can't retrieve random route_id!.. Try again."; |
| 22 | 22 | return; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - $route=$route->getRoutes($route_id,null); |
|
| 25 | + $route = $route->getRoutes($route_id, null); |
|
| 26 | 26 | |
| 27 | - $optimizationProblemId=$route->getOptimizationId(); |
|
| 27 | + $optimizationProblemId = $route->getOptimizationId(); |
|
| 28 | 28 | |
| 29 | 29 | echo "route_id = $route_id<br>"; |
| 30 | 30 | echo "optimization_problem_id = $optimizationProblemId <br><br>"; |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 5 | 5 | |
| 6 | 6 | require $vdir.'/../vendor/autoload.php'; |
| 7 | 7 | |
@@ -14,8 +14,8 @@ discard block |
||
| 14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 15 | 15 | |
| 16 | 16 | |
| 17 | - $orderParameters=Order::fromArray(array( |
|
| 18 | - 'order_ids' => array ( |
|
| 17 | + $orderParameters = Order::fromArray(array( |
|
| 18 | + 'order_ids' => array( |
|
| 19 | 19 | 0 => 73, |
| 20 | 20 | 1 => 74, |
| 21 | 21 | ) |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 5 | 5 | |
| 6 | 6 | require $vdir.'/../vendor/autoload.php'; |
| 7 | 7 | |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | // Set the api key in the Route4me class |
| 14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 15 | 15 | |
| 16 | - $orderParameters=Order::fromArray(array( |
|
| 16 | + $orderParameters = Order::fromArray(array( |
|
| 17 | 17 | "optimization_problem_id" => "E0883C1A2C7B3AAA9397BDDF90C9CFF8", |
| 18 | 18 | "redirect" => 0, |
| 19 | 19 | )); |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | $order = new Order(); |
| 26 | 26 | |
| 27 | - $response = $order->addOrder2Destination($orderParameters,$body); |
|
| 27 | + $response = $order->addOrder2Destination($orderParameters, $body); |
|
| 28 | 28 | |
| 29 | 29 | Route4Me::simplePrint($response); |
| 30 | 30 | ?> |
| 31 | 31 | \ No newline at end of file |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 5 | 5 | |
| 6 | 6 | require $vdir.'/../vendor/autoload.php'; |
| 7 | 7 | |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 15 | 15 | |
| 16 | 16 | |
| 17 | - $orderParameters=Order::fromArray(array( |
|
| 17 | + $orderParameters = Order::fromArray(array( |
|
| 18 | 18 | "order_id" => 78 |
| 19 | 19 | )); |
| 20 | 20 | |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 5 | 5 | |
| 6 | 6 | require $vdir.'/../vendor/autoload.php'; |
| 7 | 7 | |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 15 | 15 | |
| 16 | 16 | |
| 17 | - $orderParameters=Order::fromArray(array( |
|
| 17 | + $orderParameters = Order::fromArray(array( |
|
| 18 | 18 | "route_id" => "28DAE34FE8341C30CA58726E10B6F8E9", |
| 19 | 19 | "redirect" => 0, |
| 20 | 20 | )); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | $order = new Order(); |
| 27 | 27 | |
| 28 | - $response = $order->addOrder2Route($orderParameters,$body); |
|
| 28 | + $response = $order->addOrder2Route($orderParameters, $body); |
|
| 29 | 29 | |
| 30 | 30 | Route4Me::simplePrint($response); |
| 31 | 31 | ?> |
| 32 | 32 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -require __DIR__.'/../vendor/autoload.php';; |
|
| 2 | +require __DIR__.'/../vendor/autoload.php'; ; |
|
| 3 | 3 | |
| 4 | 4 | use Route4Me\Route4Me; |
| 5 | 5 | use Route4Me\Enum\OptimizationType; |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | $json = array_slice($json, 0, 10); |
| 23 | 23 | |
| 24 | 24 | $addresses = array(); |
| 25 | -foreach($json as $address) { |
|
| 25 | +foreach ($json as $address) { |
|
| 26 | 26 | $addresses[] = Address::fromArray($address); |
| 27 | 27 | } |
| 28 | 28 | |