@@ -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\Route; |
@@ -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\Route; |
@@ -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\Route; |
@@ -52,5 +52,5 @@ discard block |
||
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 | } |
@@ -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\Route; |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | assert(!is_null($address_id), "can't retrieve random address"); |
37 | 37 | |
38 | 38 | // Mark the address as detected as visited |
39 | -$addressParameters=(array)Address::fromArray(array( |
|
39 | +$addressParameters = (array)Address::fromArray(array( |
|
40 | 40 | "route_id" => $routeId, |
41 | 41 | "route_destination_id" => $address_id, |
42 | 42 | )); |
43 | 43 | |
44 | -$body= array( |
|
44 | +$body = array( |
|
45 | 45 | "is_visited" => TRUE, |
46 | 46 | ); |
47 | 47 |
@@ -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\Address; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | assert(!is_null($route_destination_id), "can't retrieve random address"); |
27 | 27 | |
28 | 28 | // Mark the address as deoarted |
29 | -$address=new Address(); |
|
29 | +$address = new Address(); |
|
30 | 30 | |
31 | 31 | $params = array( |
32 | 32 | "route_id" => $routeId, |
@@ -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\Route; |
@@ -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\Route; |
@@ -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\Route; |
@@ -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."; |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | // Get random source destination from selected source route above |
40 | -$addressRand=(array)$route->GetRandomAddressFromRoute($route_id0); |
|
41 | -$route_destination_id=$addressRand['route_destination_id']; |
|
40 | +$addressRand = (array)$route->GetRandomAddressFromRoute($route_id0); |
|
41 | +$route_destination_id = $addressRand['route_destination_id']; |
|
42 | 42 | |
43 | 43 | assert(!is_null($route_destination_id), "Can't retrieve random address."); |
44 | 44 | |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | // Get random destination route from test routes |
48 | 48 | $to_route_id = $route_id0; |
49 | 49 | |
50 | -while ($to_route_id == $route_id0) { |
|
51 | - $to_route_id = $routes[rand(0, sizeof($routes)-1)]->route_id; |
|
50 | +while ($to_route_id==$route_id0) { |
|
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,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\Route; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | "route_destination_id" => $route_destination_id, |
44 | 44 | )); |
45 | 45 | |
46 | -$body= array( |
|
46 | +$body = array( |
|
47 | 47 | "is_departed" => TRUE, |
48 | 48 | ); |
49 | 49 |