@@ -21,7 +21,7 @@ |
||
21 | 21 | $json = json_decode(file_get_contents('./addresses.json'), true); |
22 | 22 | |
23 | 23 | $addresses = array(); |
24 | -foreach($json as $address) { |
|
24 | +foreach ($json as $address) { |
|
25 | 25 | $addresses[] = Address::fromArray($address); |
26 | 26 | } |
27 | 27 |
@@ -146,7 +146,7 @@ |
||
146 | 146 | |
147 | 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 { |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | |
66 | 66 | public static function fromArray(array $params) |
67 | 67 | { |
68 | - $member= new Member(); |
|
68 | + $member = new Member(); |
|
69 | 69 | |
70 | - foreach($params as $key => $value) { |
|
70 | + foreach ($params as $key => $value) { |
|
71 | 71 | if (property_exists($member, $key)) { |
72 | 72 | $member->{$key} = $value; |
73 | 73 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | foreach ($members['results'] as $memb) { |
157 | 157 | if (isset($memb['member_id']) && isset($memb['member_type'])) { |
158 | 158 | if ($memberType==$memb['member_type']) { |
159 | - $memberIDs[]=$memb['member_id']; |
|
159 | + $memberIDs[] = $memb['member_id']; |
|
160 | 160 | } |
161 | 161 | } |
162 | 162 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | |
204 | 204 | $isValid = TRUE; |
205 | 205 | |
206 | - for ($i=0; $i<sizeof($weekdays); $i++) { |
|
206 | + for ($i = 0; $i<sizeof($weekdays); $i++) { |
|
207 | 207 | if (is_numeric($weekdays[$i])) { |
208 | 208 | $wday = intval($weekdays[$i]); |
209 | 209 | if ($wday<1 || $wday>7) { |
@@ -238,10 +238,10 @@ discard block |
||
238 | 238 | |
239 | 239 | $isValid = TRUE; |
240 | 240 | |
241 | - for ($i=0; $i<sizeof($monthlyDates); $i++) { |
|
241 | + for ($i = 0; $i<sizeof($monthlyDates); $i++) { |
|
242 | 242 | if (is_numeric($monthlyDates[$i])) { |
243 | 243 | $mday = intval($monthlyDates[$i]); |
244 | - if ($mday <1 || $mday > 31) { |
|
244 | + if ($mday<1 || $mday>31) { |
|
245 | 245 | $isValid = FALSE; |
246 | 246 | } |
247 | 247 | } else { |
@@ -338,10 +338,10 @@ discard block |
||
338 | 338 | |
339 | 339 | if (isset($rows[$locationsFieldsMapping['schedule_every']])) { |
340 | 340 | if ($this->validateScheduleEvery($rows[$locationsFieldsMapping['schedule_every']])) { |
341 | - $curSchedule.='"'.$mode.'":{'.'"every":'.$rows[$locationsFieldsMapping['schedule_every']].','; |
|
341 | + $curSchedule .= '"'.$mode.'":{'.'"every":'.$rows[$locationsFieldsMapping['schedule_every']].','; |
|
342 | 342 | if ($mode=='daily') { |
343 | - $curSchedule = trim($curSchedule,','); |
|
344 | - $curSchedule.='}'; |
|
343 | + $curSchedule = trim($curSchedule, ','); |
|
344 | + $curSchedule .= '}'; |
|
345 | 345 | } |
346 | 346 | } else { |
347 | 347 | array_push($results['fail'], "$iRow --> The parameter sched_every is not set"); |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | |
431 | 431 | $curSchedule = '[{'.$curSchedule.'}]'; |
432 | 432 | |
433 | - $oSchedule = json_decode($curSchedule,TRUE); |
|
433 | + $oSchedule = json_decode($curSchedule, TRUE); |
|
434 | 434 | |
435 | 435 | $parametersArray = array(); |
436 | 436 |
@@ -59,13 +59,13 @@ discard block |
||
59 | 59 | public $weight_metric; |
60 | 60 | public $max_weight_per_axle_group_metric; |
61 | 61 | |
62 | - public function __construct () |
|
62 | + public function __construct() |
|
63 | 63 | { |
64 | 64 | Route4Me::setBaseUrl(Endpoint::WH_BASE_URL); |
65 | 65 | } |
66 | 66 | |
67 | 67 | public static function fromArray(array $params) { |
68 | - $vehicle= new Vehicle(); |
|
68 | + $vehicle = new Vehicle(); |
|
69 | 69 | foreach ($params as $key => $value) { |
70 | 70 | if (property_exists($vehicle, $key)) { |
71 | 71 | $vehicle->{$key} = $value; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | return $response; |
89 | 89 | } |
90 | 90 | |
91 | - public function getRandomVehicleId($page,$perPage) |
|
91 | + public function getRandomVehicleId($page, $perPage) |
|
92 | 92 | { |
93 | 93 | $params = array( |
94 | 94 | 'page' => isset($page) ? $page : 1, |
@@ -32,7 +32,7 @@ |
||
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, |