@@ -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 | -$territory=new Territory(); |
|
16 | +$territory = new Territory(); |
|
17 | 17 | |
18 | 18 | // Select a terriotry with the addresses from the list |
19 | 19 | $params = 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; |
@@ -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, 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, |
@@ -33,7 +33,7 @@ |
||
33 | 33 | { |
34 | 34 | $activityparameters = new ActivityParameters(); |
35 | 35 | |
36 | - foreach($params as $key => $value) { |
|
36 | + foreach ($params as $key => $value) { |
|
37 | 37 | if (property_exists($activityparameters, $key)) { |
38 | 38 | $activityparameters->{$key} = $value; |
39 | 39 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | |
8 | 8 | class Territory extends Common |
9 | 9 | { |
10 | - public $territory_id; // Territory id |
|
10 | + public $territory_id; // Territory id |
|
11 | 11 | public $territory_name; |
12 | 12 | public $territory_color; |
13 | 13 | public $addresses; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | $territoryparameters = new Territory(); |
31 | 31 | |
32 | - foreach($params as $key => $value) { |
|
32 | + foreach ($params as $key => $value) { |
|
33 | 33 | if (property_exists($territoryparameters, $key)) { |
34 | 34 | $territoryparameters->{$key} = $value; |
35 | 35 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $param->setParameters(RouteParameters::fromArray($params['parameters'])); |
35 | 35 | } |
36 | 36 | |
37 | - foreach($params['addresses'] as $address) { |
|
37 | + foreach ($params['addresses'] as $address) { |
|
38 | 38 | if (!($address instanceof Address)) { |
39 | 39 | $address = Address::fromArray($address); |
40 | 40 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | { |
78 | 78 | $addresses = array(); |
79 | 79 | |
80 | - foreach($this->addresses as $address) { |
|
80 | + foreach ($this->addresses as $address) { |
|
81 | 81 | $addresses[] = $address->toArray(); |
82 | 82 | } |
83 | 83 |
@@ -44,18 +44,18 @@ |
||
44 | 44 | const ORDER_V4 = '/api.v4/order.php'; |
45 | 45 | |
46 | 46 | const ROUTE_V4 = '/api.v4/route.php'; |
47 | - const ROUTE_DUPLICATE ='/actions/duplicate_route.php'; |
|
48 | - const ROUTES_DELETE ='/actions/delete_routes.php'; |
|
49 | - const REOPTIMIZE_V3_2 ='/api.v3/route/reoptimize_2.php'; |
|
50 | - const ROUTES_MERGE ='/actions/merge_routes.php'; |
|
51 | - const ROUTE_SHARE ='/actions/route/share_route.php'; |
|
52 | - const ROUTE_NOTES_ADD ='/actions/addRouteNotes.php'; |
|
53 | - const STATUS_V4 ='/api.v4/status.php'; |
|
54 | - const GET_DEVICE_LOCATION ='/api/track/get_device_location.php'; |
|
55 | - |
|
56 | - const TRACK_SET ='/track/set.php'; |
|
57 | - |
|
58 | - const NOTE_CUSTOM_TYPES_V4 ='/api.v4/note_custom_types.php'; |
|
47 | + const ROUTE_DUPLICATE = '/actions/duplicate_route.php'; |
|
48 | + const ROUTES_DELETE = '/actions/delete_routes.php'; |
|
49 | + const REOPTIMIZE_V3_2 = '/api.v3/route/reoptimize_2.php'; |
|
50 | + const ROUTES_MERGE = '/actions/merge_routes.php'; |
|
51 | + const ROUTE_SHARE = '/actions/route/share_route.php'; |
|
52 | + const ROUTE_NOTES_ADD = '/actions/addRouteNotes.php'; |
|
53 | + const STATUS_V4 = '/api.v4/status.php'; |
|
54 | + const GET_DEVICE_LOCATION = '/api/track/get_device_location.php'; |
|
55 | + |
|
56 | + const TRACK_SET = '/track/set.php'; |
|
57 | + |
|
58 | + const NOTE_CUSTOM_TYPES_V4 = '/api.v4/note_custom_types.php'; |
|
59 | 59 | |
60 | 60 | const VEHICLE_V4 = '/api/vehicles'; |
61 | 61 | } |
@@ -10,6 +10,6 @@ |
||
10 | 10 | const TSP_TW = 5; |
11 | 11 | const TSP_TW_CR = 6; |
12 | 12 | const BBCVRP = 7; |
13 | - const ALG_NONE = 100; |
|
13 | + const ALG_NONE = 100; |
|
14 | 14 | const ALG_LEGACY_DISTRIBUTED = 101; |
15 | 15 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | |
8 | 8 | class AvoidanceZone extends Common |
9 | 9 | { |
10 | - public $territory_id; // Avoidance zone id |
|
10 | + public $territory_id; // Avoidance zone id |
|
11 | 11 | public $territory_name; |
12 | 12 | public $territory_color; |
13 | 13 | public $orders; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | $avoidanceZoneParameters = new AvoidanceZone(); |
32 | 32 | |
33 | - foreach($params as $key => $value) { |
|
33 | + foreach ($params as $key => $value) { |
|
34 | 34 | if (property_exists($avoidanceZoneParameters, $key)) { |
35 | 35 | $avoidanceZoneParameters->{$key} = $value; |
36 | 36 | } |
@@ -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; |