@@ -12,7 +12,7 @@ |
||
12 | 12 | public function toArray() |
13 | 13 | { |
14 | 14 | $params = array_filter(get_object_vars($this), function($item) { |
15 | - return ($item !== null) && !(is_array($item) && !count($item)); |
|
15 | + return ($item!==null) && !(is_array($item) && !count($item)); |
|
16 | 16 | }); |
17 | 17 | |
18 | 18 | return $params; |
@@ -48,7 +48,7 @@ |
||
48 | 48 | public static function fromArray(array $params) |
49 | 49 | { |
50 | 50 | $routeParams = new RouteParameters(); |
51 | - foreach($params as $key => $value) { |
|
51 | + foreach ($params as $key => $value) { |
|
52 | 52 | if (property_exists($routeParams, $key)) { |
53 | 53 | $routeParams->{$key} = $value; |
54 | 54 | } |
@@ -1,7 +1,7 @@ |
||
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; |
@@ -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 |
@@ -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 |
@@ -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,14 +25,14 @@ discard block |
||
25 | 25 | $json = json_decode(file_get_contents('./addresses.json'), true); |
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 | |
32 | 32 | $parameters = RouteParameters::fromArray(array( |
33 | 33 | "algorithm_type" => Algorithmtype::CVRP_TW_SD, |
34 | 34 | "route_name" => "Multiple Depot, Multiple Driver with 24 Stops, Time Window", |
35 | - "route_date" => time() + 24*60*60, |
|
35 | + "route_date" => time() + 24 * 60 * 60, |
|
36 | 36 | "route_time" => 60 * 60 * 7, |
37 | 37 | "distance_unit" => DistanceUnit::MILES, |
38 | 38 | "device_type" => DeviceType::WEB, |
@@ -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; |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | $customNotes = $address->getAllCustomNoteTypes(); |
20 | 20 | |
21 | 21 | assert(!is_null($customNotes), "Can't retrieve all custom note types"); |
22 | -assert(sizeof($customNotes) > 0, "There is no custom note type in the user's account"); |
|
22 | +assert(sizeof($customNotes)>0, "There is no custom note type in the user's account"); |
|
23 | 23 | |
24 | -$randomCustomNoteID = $customNotes[rand(0,sizeof($customNotes)-1)]['note_custom_type_id']; |
|
24 | +$randomCustomNoteID = $customNotes[rand(0, sizeof($customNotes) - 1)]['note_custom_type_id']; |
|
25 | 25 | |
26 | 26 | // Remove a custom note type |
27 | 27 | $noteParameters = array( |
@@ -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,14 +24,14 @@ discard block |
||
24 | 24 | $json = json_decode(file_get_contents('./addresses.json'), true); |
25 | 25 | |
26 | 26 | $addresses = array(); |
27 | -foreach($json as $address) { |
|
27 | +foreach ($json as $address) { |
|
28 | 28 | $addresses[] = Address::fromArray($address); |
29 | 29 | } |
30 | 30 | |
31 | 31 | $parameters = RouteParameters::fromArray(array( |
32 | 32 | "algorithm_type" => Algorithmtype::TSP, |
33 | 33 | "route_name" => "Single Driver Multiple TimeWindows 12 Stops", |
34 | - "route_date" => time() + 24*60*60, |
|
34 | + "route_date" => time() + 24 * 60 * 60, |
|
35 | 35 | "route_time" => 5 * 3600 + 30 * 60, |
36 | 36 | "distance_unit" => DistanceUnit::MILES, |
37 | 37 | "device_type" => DeviceType::WEB, |
@@ -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,14 +25,14 @@ discard block |
||
25 | 25 | $json = json_decode(file_get_contents('./addresses.json'), true); |
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 | |
32 | 32 | $parameters = RouteParameters::fromArray(array( |
33 | 33 | "algorithm_type" => Algorithmtype::CVRP_TW_SD, |
34 | 34 | "route_name" => "Single Depot, Multiple Driver, No Time Window", |
35 | - "route_date" => time() + 24*60*60, |
|
35 | + "route_date" => time() + 24 * 60 * 60, |
|
36 | 36 | "route_time" => 60 * 60 * 7, |
37 | 37 | "rt" => TRUE, |
38 | 38 | "distance_unit" => DistanceUnit::MILES, |