@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | // Reoptimize an optimization |
23 | 23 | $problemParams = array( |
24 | - 'optimization_problem_id' => $optimizationProblemId |
|
24 | + 'optimization_problem_id' => $optimizationProblemId |
|
25 | 25 | ); |
26 | 26 | |
27 | 27 | $problem = OptimizationProblem::reoptimize($problemParams); |
@@ -1,8 +1,8 @@ |
||
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\OptimizationProblem; |
8 | 8 | use Route4Me\Route4Me; |
@@ -22,11 +22,11 @@ |
||
22 | 22 | |
23 | 23 | // Get an optimization problem |
24 | 24 | $optimizationProblemParams = array( |
25 | - "optimization_problem_id" => $optimizationProblemId |
|
25 | + "optimization_problem_id" => $optimizationProblemId |
|
26 | 26 | ); |
27 | 27 | |
28 | 28 | $optimizationProblem = $optimization->get($optimizationProblemParams); |
29 | 29 | |
30 | 30 | foreach ((array)$optimizationProblem as $probParts) { |
31 | - Route4Me::simplePrint((array)$probParts); |
|
31 | + Route4Me::simplePrint((array)$probParts); |
|
32 | 32 | } |
@@ -1,8 +1,8 @@ |
||
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\OptimizationProblem; |
@@ -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 | $json = array_slice($json, 0, 10); |
26 | 26 | |
27 | 27 | $addresses = array(); |
28 | -foreach($json as $address) { |
|
28 | +foreach ($json as $address) { |
|
29 | 29 | $addresses[] = Address::fromArray($address); |
30 | 30 | } |
31 | 31 |
@@ -20,12 +20,12 @@ |
||
20 | 20 | |
21 | 21 | // Get route manifest |
22 | 22 | $params = array( |
23 | - "directions" => 1 |
|
23 | + "directions" => 1 |
|
24 | 24 | ); |
25 | 25 | |
26 | 26 | $route = Route::getRoutes($route_id, $params); |
27 | 27 | |
28 | 28 | foreach ($route->addresses as $addr1) { |
29 | - Route4Me::simplePrint((array)$addr1, true); |
|
30 | - echo "<br>"; |
|
29 | + Route4Me::simplePrint((array)$addr1, true); |
|
30 | + echo "<br>"; |
|
31 | 31 | } |
@@ -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; |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $route = new Route(); |
16 | 16 | |
17 | 17 | // Get a random route ID |
18 | -$route_id=$route->getRandomRouteId(0, 10); |
|
18 | +$route_id = $route->getRandomRouteId(0, 10); |
|
19 | 19 | assert(!is_null($route_id), "Can't retrieve a random route ID"); |
20 | 20 | |
21 | 21 | // Get route manifest |
@@ -16,13 +16,13 @@ |
||
16 | 16 | $order = new Order(); |
17 | 17 | |
18 | 18 | $orderParameters=Order::fromArray(array( |
19 | - "offset" => 0, |
|
20 | - 'limit' => 5, |
|
19 | + "offset" => 0, |
|
20 | + 'limit' => 5, |
|
21 | 21 | )); |
22 | 22 | |
23 | 23 | $response = $order->getOrders($orderParameters); |
24 | 24 | |
25 | 25 | foreach ($response['results'] as $key => $order) { |
26 | - Route4Me::simplePrint($order); |
|
27 | - echo "<br>"; |
|
26 | + Route4Me::simplePrint($order); |
|
27 | + echo "<br>"; |
|
28 | 28 | } |
@@ -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; |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | $order = new Order(); |
17 | 17 | |
18 | -$orderParameters=Order::fromArray(array( |
|
18 | +$orderParameters = Order::fromArray(array( |
|
19 | 19 | "offset" => 0, |
20 | 20 | 'limit' => 5, |
21 | 21 | )); |
@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | // Get an order |
27 | 27 | $orderParameters=Order::fromArray(array( |
28 | - "order_id" => $orderID |
|
28 | + "order_id" => $orderID |
|
29 | 29 | )); |
30 | 30 | |
31 | 31 | $response = $order->getOrder($orderParameters); |
@@ -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; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | assert(!is_null($orderID), "Can't retrieve a random order ID"); |
25 | 25 | |
26 | 26 | // Get an order |
27 | -$orderParameters=Order::fromArray(array( |
|
27 | +$orderParameters = Order::fromArray(array( |
|
28 | 28 | "order_id" => $orderID |
29 | 29 | )); |
30 | 30 |
@@ -14,9 +14,9 @@ discard block |
||
14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
15 | 15 | |
16 | 16 | $orderParameters=Order::fromArray(array( |
17 | - "day_added_YYMMDD" => date("Y-m-d", strtotime( '-1 days' )), |
|
18 | - "offset" => 0, |
|
19 | - "limit" => 5 |
|
17 | + "day_added_YYMMDD" => date("Y-m-d", strtotime( '-1 days' )), |
|
18 | + "offset" => 0, |
|
19 | + "limit" => 5 |
|
20 | 20 | )); |
21 | 21 | |
22 | 22 | $order = new Order(); |
@@ -24,6 +24,6 @@ discard block |
||
24 | 24 | $response = $order->getOrder($orderParameters); |
25 | 25 | |
26 | 26 | foreach ($response['results'] as $key => $order) { |
27 | - Route4Me::simplePrint($order); |
|
28 | - echo "<br>"; |
|
27 | + Route4Me::simplePrint($order); |
|
28 | + echo "<br>"; |
|
29 | 29 | } |
@@ -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,8 +13,8 @@ discard block |
||
13 | 13 | // This example not available for demo API key |
14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
15 | 15 | |
16 | -$orderParameters=Order::fromArray(array( |
|
17 | - "day_added_YYMMDD" => date("Y-m-d", strtotime( '-1 days' )), |
|
16 | +$orderParameters = Order::fromArray(array( |
|
17 | + "day_added_YYMMDD" => date("Y-m-d", strtotime('-1 days')), |
|
18 | 18 | "offset" => 0, |
19 | 19 | "limit" => 5 |
20 | 20 | )); |
@@ -12,25 +12,25 @@ |
||
12 | 12 | Route4Me::setApiKey('11111111111111111111111111111111'); |
13 | 13 | |
14 | 14 | $orderParameters=Order::fromArray(array( |
15 | - "address_1" => "318 S 39th St, Louisville, KY 40212, USA", |
|
16 | - "cached_lat" => 38.259326, |
|
17 | - "cached_lng" => -85.814979, |
|
18 | - "curbside_lat" => 38.259326, |
|
19 | - "curbside_lng" => -85.814979, |
|
20 | - "address_alias" => "318 S 39th St 40212", |
|
21 | - "address_city" => "Louisville", |
|
22 | - "EXT_FIELD_first_name" => "Lui", |
|
23 | - "EXT_FIELD_last_name" => "Carol", |
|
24 | - "EXT_FIELD_email" => "[email protected]", |
|
25 | - "EXT_FIELD_phone" => "897946541", |
|
26 | - "EXT_FIELD_custom_data" => array("order_type" => "scheduled order"), |
|
27 | - "day_scheduled_for_YYMMDD" => date("Y-m-d"), |
|
28 | - "local_time_window_end" => 39000, |
|
29 | - "local_time_window_end_2" => 46200, |
|
30 | - "local_time_window_start" => 37800, |
|
31 | - "local_time_window_start_2" => 45000, |
|
32 | - "local_timezone_string" => "America/New_York", |
|
33 | - "order_icon" => "emoji/emoji-bank" |
|
15 | + "address_1" => "318 S 39th St, Louisville, KY 40212, USA", |
|
16 | + "cached_lat" => 38.259326, |
|
17 | + "cached_lng" => -85.814979, |
|
18 | + "curbside_lat" => 38.259326, |
|
19 | + "curbside_lng" => -85.814979, |
|
20 | + "address_alias" => "318 S 39th St 40212", |
|
21 | + "address_city" => "Louisville", |
|
22 | + "EXT_FIELD_first_name" => "Lui", |
|
23 | + "EXT_FIELD_last_name" => "Carol", |
|
24 | + "EXT_FIELD_email" => "[email protected]", |
|
25 | + "EXT_FIELD_phone" => "897946541", |
|
26 | + "EXT_FIELD_custom_data" => array("order_type" => "scheduled order"), |
|
27 | + "day_scheduled_for_YYMMDD" => date("Y-m-d"), |
|
28 | + "local_time_window_end" => 39000, |
|
29 | + "local_time_window_end_2" => 46200, |
|
30 | + "local_time_window_start" => 37800, |
|
31 | + "local_time_window_start_2" => 45000, |
|
32 | + "local_timezone_string" => "America/New_York", |
|
33 | + "order_icon" => "emoji/emoji-bank" |
|
34 | 34 | )); |
35 | 35 | |
36 | 36 | $order = new Order(); |
@@ -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; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | // This example not available for demo API key |
12 | 12 | Route4Me::setApiKey('11111111111111111111111111111111'); |
13 | 13 | |
14 | -$orderParameters=Order::fromArray(array( |
|
14 | +$orderParameters = Order::fromArray(array( |
|
15 | 15 | "address_1" => "318 S 39th St, Louisville, KY 40212, USA", |
16 | 16 | "cached_lat" => 38.259326, |
17 | 17 | "cached_lng" => -85.814979, |
@@ -14,22 +14,22 @@ |
||
14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
15 | 15 | |
16 | 16 | $orderParameters=Order::fromArray(array( |
17 | - "address_1" => "1358 E Luzerne St, Philadelphia, PA 19124, US", |
|
18 | - "cached_lat" => 48.335991, |
|
19 | - "cached_lng" => 31.18287, |
|
20 | - "address_alias" => "Auto test address", |
|
21 | - "address_city" => "Philadelphia", |
|
22 | - "day_scheduled_for_YYMMDD" => date("Y-m-d"), |
|
23 | - "EXT_FIELD_first_name" => "Igor", |
|
24 | - "EXT_FIELD_last_name" => "Progman", |
|
25 | - "EXT_FIELD_email" => "[email protected]", |
|
26 | - "EXT_FIELD_phone" => "380380380380", |
|
27 | - "EXT_FIELD_custom_data" => array( |
|
28 | - 0 => array( |
|
29 | - 'order_id' => '10', |
|
30 | - 'name' => 'Bill Soul' |
|
31 | - ) |
|
32 | - ) |
|
17 | + "address_1" => "1358 E Luzerne St, Philadelphia, PA 19124, US", |
|
18 | + "cached_lat" => 48.335991, |
|
19 | + "cached_lng" => 31.18287, |
|
20 | + "address_alias" => "Auto test address", |
|
21 | + "address_city" => "Philadelphia", |
|
22 | + "day_scheduled_for_YYMMDD" => date("Y-m-d"), |
|
23 | + "EXT_FIELD_first_name" => "Igor", |
|
24 | + "EXT_FIELD_last_name" => "Progman", |
|
25 | + "EXT_FIELD_email" => "[email protected]", |
|
26 | + "EXT_FIELD_phone" => "380380380380", |
|
27 | + "EXT_FIELD_custom_data" => array( |
|
28 | + 0 => array( |
|
29 | + 'order_id' => '10', |
|
30 | + 'name' => 'Bill Soul' |
|
31 | + ) |
|
32 | + ) |
|
33 | 33 | )); |
34 | 34 | |
35 | 35 | $order = new Order(); |
@@ -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 | "address_1" => "1358 E Luzerne St, Philadelphia, PA 19124, US", |
18 | 18 | "cached_lat" => 48.335991, |
19 | 19 | "cached_lng" => 31.18287, |