@@ -144,9 +144,9 @@ discard block |
||
144 | 144 | { |
145 | 145 | $optimizations = self::get(array('offset' => $offset, 'limit' => $limit)); |
146 | 146 | |
147 | - $rOptimization = $optimizations[rand(0,sizeof($optimizations)-1)]; |
|
147 | + $rOptimization = $optimizations[rand(0, sizeof($optimizations) - 1)]; |
|
148 | 148 | |
149 | - if(!isset($rOptimization->optimization_problem_id)) { |
|
149 | + if (!isset($rOptimization->optimization_problem_id)) { |
|
150 | 150 | if (sizeof($optimizations)>9) { |
151 | 151 | $this->getRandomOptimizationId($offset, $limit); |
152 | 152 | } else { |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | return null; |
164 | 164 | } |
165 | 165 | |
166 | - $params = array("optimization_problem_id" => $opt_id ); |
|
166 | + $params = array("optimization_problem_id" => $opt_id); |
|
167 | 167 | |
168 | 168 | $optimization = (array)$this->get($params); |
169 | 169 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | return null; |
182 | 182 | } |
183 | 183 | |
184 | - $num = rand(0, sizeof($addresses)-1); |
|
184 | + $num = rand(0, sizeof($addresses) - 1); |
|
185 | 185 | |
186 | 186 | $rAddress = $addresses[$num]; |
187 | 187 |
@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | Route4Me::setApiKey('11111111111111111111111111111111'); |
14 | 14 | |
15 | 15 | $AdressBookLocationParameters = AddressBookLocation::fromArray(array( |
16 | - "first_name" => "Test FirstName ".strval(rand(10000,99999)), |
|
17 | - "address_1" => "Test Address1 ".strval(rand(10000,99999)), |
|
16 | + "first_name" => "Test FirstName ".strval(rand(10000, 99999)), |
|
17 | + "address_1" => "Test Address1 ".strval(rand(10000, 99999)), |
|
18 | 18 | "cached_lat" => 38.024654, |
19 | 19 | "cached_lng" => -77.338814 |
20 | 20 | )); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $address_id = $abcResult["address_id"]; |
32 | 32 | } |
33 | 33 | |
34 | -assert($address_id != -1, "Cannot create an address book location. <br><br>"); |
|
34 | +assert($address_id!=-1, "Cannot create an address book location. <br><br>"); |
|
35 | 35 | |
36 | 36 | echo "Address Book Location with <b>address_id = ".strval($address_id)."</b> and <b>first_name = ".$abcResult['first_name']."</b> was successfully added<br>"; |
37 | 37 | |
@@ -41,6 +41,6 @@ discard block |
||
41 | 41 | |
42 | 42 | assert(isset($abcResult['first_name']), "Cannot update the address book location. <br><br>"); |
43 | 43 | |
44 | -assert($abcResult['first_name'] == 'Test Firstname Updated', "Cannot update the address book location. <br><br>"); |
|
44 | +assert($abcResult['first_name']=='Test Firstname Updated', "Cannot update the address book location. <br><br>"); |
|
45 | 45 | |
46 | 46 | echo "The field <b>first_name</b> in the address book location <b>".$address_id."</b> was update to <b>Test Firstname Updated</b> successfuly <br>"; |
@@ -38,7 +38,7 @@ |
||
38 | 38 | assert(!is_null($route_destination_id), "Can't retrieve random address"); |
39 | 39 | |
40 | 40 | // Remove the destination from the optimization |
41 | -$params = array ( |
|
41 | +$params = array( |
|
42 | 42 | "optimization_problem_id" => $optimization_problem_id, |
43 | 43 | "route_destination_id" => $route_destination_id |
44 | 44 | ); |
@@ -52,5 +52,5 @@ |
||
52 | 52 | assert(isset($result->addresses), "Can't insert a destination into the route"); |
53 | 53 | |
54 | 54 | foreach ($result->addresses as $address) { |
55 | - echo "Address -> ".$address->address , ", Sequence number -> ".$address->sequence_no."<br>"; |
|
55 | + echo "Address -> ".$address->address, ", Sequence number -> ".$address->sequence_no."<br>"; |
|
56 | 56 | } |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | // Get random source route from test routes |
28 | 28 | $route = new Route(); |
29 | 29 | |
30 | -$route_id0 = $routes[rand(0, sizeof($routes)-1)]->route_id; |
|
30 | +$route_id0 = $routes[rand(0, sizeof($routes) - 1)]->route_id; |
|
31 | 31 | |
32 | -echo "<br> From the route -> ".$route_id0 ."<br>"; |
|
32 | +echo "<br> From the route -> ".$route_id0."<br>"; |
|
33 | 33 | |
34 | 34 | if (is_null($route_id0)) { |
35 | 35 | echo "Can't retrieve random route_id!.. Try again."; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $to_route_id = $routes[rand(0, sizeof($routes) - 1)]->route_id; |
52 | 52 | } |
53 | 53 | |
54 | -echo "<br> to the route -> ".$to_route_id ."<br>"; |
|
54 | +echo "<br> to the route -> ".$to_route_id."<br>"; |
|
55 | 55 | |
56 | 56 | if (is_null($to_route_id)) { |
57 | 57 | echo "Can't retrieve random route_id!.. Try again."; |
@@ -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\Enum\DeviceType; |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | assert($status['status'], "Can't send GPS position to the selected route"); |
47 | 47 | |
48 | 48 | // Get the device tracking history from a time range |
49 | -$startDate = time() - 30*24*3600; |
|
50 | -$endDate = time() + 1*24*3600; |
|
49 | +$startDate = time() - 30 * 24 * 3600; |
|
50 | +$endDate = time() + 1 * 24 * 3600; |
|
51 | 51 | |
52 | 52 | $params = array( |
53 | 53 | 'route_id' => $routeId, |
@@ -23,7 +23,7 @@ |
||
23 | 23 | assert(!is_null($optimizationProblemId), "Can't retrieve a random optimization problem ID"); |
24 | 24 | |
25 | 25 | // Remove an optimization |
26 | -$params = array ( |
|
26 | +$params = array( |
|
27 | 27 | "optimization_problem_ids" => array( |
28 | 28 | "0" => $optimizationProblemId |
29 | 29 | ), |
@@ -29,7 +29,7 @@ |
||
29 | 29 | |
30 | 30 | // Remove 2 random orders |
31 | 31 | $orderParameters = Order::fromArray(array( |
32 | - 'order_ids' => array ( |
|
32 | + 'order_ids' => array( |
|
33 | 33 | 0 => $randomOrderID1, |
34 | 34 | 1 => $randomOrderID2, |
35 | 35 | ) |
@@ -12,7 +12,7 @@ |
||
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 |