@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root=realpath(dirname(__FILE__).'/../../'); |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | 5 | require $root.'/vendor/autoload.php'; |
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | // This example not available for demo API key |
14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
15 | 15 | |
16 | -$orderParameters=Order::fromArray(array( |
|
16 | +$orderParameters = Order::fromArray(array( |
|
17 | 17 | "fields" => "order_id,member_id", |
18 | 18 | "offset" => 0, |
19 | 19 | "limit" => 5 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root=realpath(dirname(__FILE__).'/../../'); |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | 5 | require $root.'/vendor/autoload.php'; |
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | assert(!is_null($optimizationProblemId), "Can't retrieve a random optimization problem ID"); |
26 | 26 | |
27 | 27 | // Add an order to an optimization |
28 | -$orderParameters=array( |
|
28 | +$orderParameters = array( |
|
29 | 29 | "optimization_problem_id" => $optimizationProblemId, |
30 | 30 | "redirect" => 0, |
31 | 31 | "device_type" => "web", |
@@ -37,6 +37,6 @@ discard block |
||
37 | 37 | |
38 | 38 | $order = new Order(); |
39 | 39 | |
40 | -$response = $order->addOrder2Optimization($orderParameters,$body); |
|
40 | +$response = $order->addOrder2Optimization($orderParameters, $body); |
|
41 | 41 | |
42 | 42 | Route4Me::simplePrint($response); |
@@ -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 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | // Remove 2 random orders |
32 | 32 | $orderParameters = Order::fromArray(array( |
33 | - 'order_ids' => array ( |
|
33 | + 'order_ids' => array( |
|
34 | 34 | 0 => $randomOrderID1, |
35 | 35 | 1 => $randomOrderID2, |
36 | 36 | ) |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root=realpath(dirname(__FILE__).'/../../'); |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | 5 | require $root.'/vendor/autoload.php'; |
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
@@ -19,12 +19,12 @@ discard block |
||
19 | 19 | // Get random route ID |
20 | 20 | $route = new Route(); |
21 | 21 | |
22 | -$routeID=$route->getRandomRouteId(0, 10); |
|
22 | +$routeID = $route->getRandomRouteId(0, 10); |
|
23 | 23 | |
24 | 24 | assert(!is_null($routeID), "Can't retrieve a random route ID"); |
25 | 25 | |
26 | 26 | // Add an order to a route |
27 | -$orderParameters=Order::fromArray(array( |
|
27 | +$orderParameters = Order::fromArray(array( |
|
28 | 28 | "route_id" => $routeID, |
29 | 29 | "redirect" => 0, |
30 | 30 | )); |
@@ -35,6 +35,6 @@ discard block |
||
35 | 35 | |
36 | 36 | $order = new Order(); |
37 | 37 | |
38 | -$response = $order->addOrder2Route($orderParameters,$body); |
|
38 | +$response = $order->addOrder2Route($orderParameters, $body); |
|
39 | 39 | |
40 | 40 | Route4Me::simplePrint($response); |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
5 | -require $root . '/vendor/autoload.php'; |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | +require $root.'/vendor/autoload.php'; |
|
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
8 | 8 | use Route4Me\Enum\TerritoryTypes; |
@@ -14,13 +14,13 @@ discard block |
||
14 | 14 | |
15 | 15 | $territory = new Territory(); |
16 | 16 | $territory->type = TerritoryTypes::CIRCLE; |
17 | -$territory->data = array ( |
|
17 | +$territory->data = array( |
|
18 | 18 | "37.569752822786455,-77.47833251953125", |
19 | 19 | "5000" |
20 | 20 | ); |
21 | 21 | |
22 | 22 | $AvoisanceZoneParameters = AvoidanceZone::fromArray(array( |
23 | - "territory_name" => "Test Circle Avoidance Zone ".strval(rand(10000,99999)), |
|
23 | + "territory_name" => "Test Circle Avoidance Zone ".strval(rand(10000, 99999)), |
|
24 | 24 | "territory_color" => "ff7700", |
25 | 25 | "territory" => $territory |
26 | 26 | )); |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
5 | -require $root . '/vendor/autoload.php'; |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | +require $root.'/vendor/autoload.php'; |
|
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
8 | 8 | use Route4Me\Enum\TerritoryTypes; |
@@ -13,14 +13,14 @@ discard block |
||
13 | 13 | // Example refers to the process of creating Avoidance Zone with rectangular shape |
14 | 14 | |
15 | 15 | $territory = new Territory(); |
16 | -$territory->type = TerritoryTypes::RECT; |
|
17 | -$territory->data = array ( |
|
16 | +$territory->type = TerritoryTypes::RECT; |
|
17 | +$territory->data = array( |
|
18 | 18 | "43.51668853502909,-109.3798828125", |
19 | 19 | "46.98025235521883,-101.865234375" |
20 | 20 | ); |
21 | 21 | |
22 | 22 | $AvoidanceZoneParameters = AvoidanceZone::fromArray(array( |
23 | - "territory_name" => "Test Rectangular Avoidance Zone ".strval(rand(10000,99999)), |
|
23 | + "territory_name" => "Test Rectangular Avoidance Zone ".strval(rand(10000, 99999)), |
|
24 | 24 | "territory_color" => "ff7700", |
25 | 25 | "territory" => $territory |
26 | 26 | )); |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
5 | -require $root . '/vendor/autoload.php'; |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | +require $root.'/vendor/autoload.php'; |
|
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
8 | 8 | use Route4Me\Enum\TerritoryTypes; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | $avoidancezone = new AvoidanceZone(); |
14 | 14 | |
15 | -$queryparameters = array (); |
|
15 | +$queryparameters = array(); |
|
16 | 16 | |
17 | 17 | $azones = $avoidancezone->getAvoidanceZones($queryparameters); |
18 | 18 |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
5 | -require $root . '/vendor/autoload.php'; |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | +require $root.'/vendor/autoload.php'; |
|
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
8 | 8 | use Route4Me\Enum\TerritoryTypes; |
@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | // Example refers to the process of creating Avoidance Zone with poligonian shape |
14 | 14 | |
15 | 15 | $territory = new Territory(); |
16 | -$territory->type = TerritoryTypes::POLY; |
|
17 | -$territory->data = array ( |
|
16 | +$territory->type = TerritoryTypes::POLY; |
|
17 | +$territory->data = array( |
|
18 | 18 | "37.769752822786455,-77.67833251953125", |
19 | 19 | "37.75886716305343,-77.68974800109863", |
20 | 20 | "37.74763966054455,-77.6917221069336", |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | ); |
28 | 28 | |
29 | 29 | $AvoidanceZoneParameters = AvoidanceZone::fromArray(array( |
30 | - "territory_name" => "Test Poligonian Avoidance Zone ".strval(rand(10000,99999)), |
|
30 | + "territory_name" => "Test Poligonian Avoidance Zone ".strval(rand(10000, 99999)), |
|
31 | 31 | "territory_color" => "ff7700", |
32 | 32 | "territory" => $territory |
33 | 33 | )); |
34 | 34 | |
35 | -$avoidancezone =new AvoidanceZone(); |
|
35 | +$avoidancezone = new AvoidanceZone(); |
|
36 | 36 | |
37 | 37 | $result = $avoidancezone->addAvoidanceZone($AvoidanceZoneParameters); |
38 | 38 |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
5 | -require $root . '/vendor/autoload.php'; |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | +require $root.'/vendor/autoload.php'; |
|
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
8 | 8 | use Route4Me\Enum\TerritoryTypes; |
@@ -16,13 +16,13 @@ discard block |
||
16 | 16 | // Add Avoidance Zone and get territory_id |
17 | 17 | $territory = new Territory(); |
18 | 18 | $territory->type = TerritoryTypes::CIRCLE; |
19 | -$territory->data = array ( |
|
19 | +$territory->data = array( |
|
20 | 20 | "37.569752822786455,-77.47833251953125", |
21 | 21 | "5000" |
22 | 22 | ); |
23 | 23 | |
24 | 24 | $AvoisanceZoneParameters = AvoidanceZone::fromArray(array( |
25 | - "territory_name" => "Test Territory ".strval(rand(10000,99999)), |
|
25 | + "territory_name" => "Test Territory ".strval(rand(10000, 99999)), |
|
26 | 26 | "territory_color" => "ff7700", |
27 | 27 | "territory" => $territory |
28 | 28 | )); |