@@ -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 | |
@@ -25,6 +25,6 @@ discard block |
||
25 | 25 | $addressID = $randomLocation["address_id"]; |
26 | 26 | $abcResult = $abLocation->getAddressBookLocation($addressID); |
27 | 27 | |
28 | -$results = $abLocation->getValue($abcResult,"results"); |
|
28 | +$results = $abLocation->getValue($abcResult, "results"); |
|
29 | 29 | |
30 | 30 | Route4Me::simplePrint($results); |
@@ -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; |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | $abcResults = $abContacts->getAddressBookLocations($AdressBookLocationParameters); |
23 | 23 | |
24 | -$results = $abContacts->getValue($abcResults,"results"); |
|
24 | +$results = $abContacts->getValue($abcResults, "results"); |
|
25 | 25 | |
26 | 26 | foreach ($results as $result) { |
27 | 27 | Route4Me::simplePrint($result); |
@@ -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; |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | |
23 | 23 | $abcResults = $abContacts->getAddressBookLocations($adressBookLocationParameters); |
24 | 24 | |
25 | -$results = $abContacts->getValue($abcResults,"results"); |
|
25 | +$results = $abContacts->getValue($abcResults, "results"); |
|
26 | 26 | |
27 | 27 | $contactsNumber = sizeof($results); |
28 | -$id1 = $results[rand(1, $contactsNumber)-1]['address_id']; |
|
29 | -$id2 = $results[rand(1, $contactsNumber)-1]['address_id']; |
|
28 | +$id1 = $results[rand(1, $contactsNumber) - 1]['address_id']; |
|
29 | +$id2 = $results[rand(1, $contactsNumber) - 1]['address_id']; |
|
30 | 30 | $ids = $id1.",".$id2; |
31 | 31 | |
32 | 32 | // Retrieve address book locations by address_ids |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | $abcResult = $ablocation->getAddressBookLocationsByIDs($ids); |
36 | 36 | |
37 | -$results = $ablocation->getValue($abcResult,"results"); |
|
37 | +$results = $ablocation->getValue($abcResult, "results"); |
|
38 | 38 | |
39 | 39 | foreach ($results as $result) { |
40 | 40 | Route4Me::simplePrint($result); |
@@ -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 | // Set the api key in the Route4Me class |
14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
15 | 15 | |
16 | -$route=new Route(); |
|
16 | +$route = new Route(); |
|
17 | 17 | |
18 | 18 | // Get random route ID |
19 | 19 | $randomRouteID = $route->getRandomRouteId(0, 25); |
@@ -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; |
@@ -26,6 +26,6 @@ discard block |
||
26 | 26 | "directions" => 1 |
27 | 27 | ); |
28 | 28 | |
29 | -$routeResults = (array)$route->getRoutePoints($route_id,$params); |
|
29 | +$routeResults = (array)$route->getRoutePoints($route_id, $params); |
|
30 | 30 | |
31 | 31 | Route4Me::simplePrint($routeResults, true); |
@@ -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; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | // Update the route destination |
31 | 31 | $route->parameters = new \stdClass(); |
32 | 32 | |
33 | -$route->addresses = array( Address::fromArray(array( |
|
33 | +$route->addresses = array(Address::fromArray(array( |
|
34 | 34 | "alias" => "new address alias", |
35 | 35 | "first_name" => "Edi", |
36 | 36 | "last_name" => "Jacobson", |
@@ -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 | echo "Random route ID 1 -> $randomRouteID1 <br> Random route ID 2 -> $randomRouteID2 <br>"; |
26 | 26 | |
27 | 27 | // Remove selected routes |
28 | -$route_ids = join(',',array($randomRouteID1,$randomRouteID2)); |
|
28 | +$route_ids = join(',', array($randomRouteID1, $randomRouteID2)); |
|
29 | 29 | |
30 | 30 | $result = $route->delete($route_ids); |
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; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | $count = 0; |
26 | 26 | |
27 | -while ($route_id1 == $route_id2) { |
|
27 | +while ($route_id1==$route_id2) { |
|
28 | 28 | $route_id2 = $route->getRandomRouteId(0, 20); |
29 | 29 | |
30 | 30 | $count++; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | foreach ($addresses as $address) { |
44 | 44 | if (isset($address->is_depot)) { |
45 | - if ($address->is_depot == true) { |
|
45 | + if ($address->is_depot==true) { |
|
46 | 46 | $depot = $address; |
47 | 47 | break; |
48 | 48 | } |
@@ -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; |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | $route = new Route(); |
19 | 19 | |
20 | -$routeResults = $route->getRoutes(null,$RouteParameters); |
|
20 | +$routeResults = $route->getRoutes(null, $RouteParameters); |
|
21 | 21 | |
22 | 22 | foreach ($routeResults as $routeResult) |
23 | 23 | { |