@@ -171,7 +171,7 @@ |
||
171 | 171 | |
172 | 172 | public function mergeRoutes($params) |
173 | 173 | { |
174 | - $allBodyFields = array('route_ids', 'depot_address', 'remove_origin', 'depot_lat', 'depot_lng'); |
|
174 | + $allBodyFields = array('route_ids', 'depot_address', 'remove_origin', 'depot_lat', 'depot_lng'); |
|
175 | 175 | |
176 | 176 | $result = Route4Me::makeRequst(array( |
177 | 177 | 'url' => Endpoint::ROUTES_MERGE, |
@@ -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 | } |
@@ -154,13 +154,13 @@ discard block |
||
154 | 154 | |
155 | 155 | foreach ($members['results'] as $memb) { |
156 | 156 | if (isset($memb['member_id']) && isset($memb['member_type'])) { |
157 | - if ($memberType==$memb['member_type']) $memberIDs[]=$memb['member_id']; |
|
157 | + if ($memberType==$memb['member_type']) $memberIDs[] = $memb['member_id']; |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | |
161 | 161 | if (sizeof($memberIDs)<1) return null; |
162 | 162 | |
163 | - $randomIndex = rand(0, sizeof($memberIDs)-1); |
|
163 | + $randomIndex = rand(0, sizeof($memberIDs) - 1); |
|
164 | 164 | |
165 | 165 | return $memberIDs[$randomIndex]; |
166 | 166 | } |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | $isValid = TRUE; |
216 | 216 | |
217 | - for ($i=0; $i<sizeof($weekdays); $i++) { |
|
217 | + for ($i = 0; $i<sizeof($weekdays); $i++) { |
|
218 | 218 | if (is_numeric($weekdays[$i])) { |
219 | 219 | $wday = intval($weekdays[$i]); |
220 | 220 | if ($wday<1 || $wday>7) $isValid = FALSE; |
@@ -241,14 +241,14 @@ discard block |
||
241 | 241 | { |
242 | 242 | $monthlyDates = explode(',', $scheduleMonthlyDates); |
243 | 243 | |
244 | - if (sizeof($monthlyDates) <1) return FALSE; |
|
244 | + if (sizeof($monthlyDates)<1) return FALSE; |
|
245 | 245 | |
246 | 246 | $isValid = TRUE; |
247 | 247 | |
248 | - for ($i=0; $i < sizeof($monthlyDates); $i++) { |
|
248 | + for ($i = 0; $i<sizeof($monthlyDates); $i++) { |
|
249 | 249 | if (is_numeric($monthlyDates[$i])) { |
250 | 250 | $mday = intval($monthlyDates[$i]); |
251 | - if ($mday <1 || $mday > 31) $isValid = FALSE; |
|
251 | + if ($mday<1 || $mday>31) $isValid = FALSE; |
|
252 | 252 | } else { |
253 | 253 | $isValid = FALSE; |
254 | 254 | } |
@@ -339,10 +339,10 @@ discard block |
||
339 | 339 | |
340 | 340 | if (isset($rows[$locationsFieldsMapping['schedule_every']])) { |
341 | 341 | if ($this->validateScheduleEvery($rows[$locationsFieldsMapping['schedule_every']])) { |
342 | - $curSchedule.='"'.$mode.'":{'.'"every":'.$rows[$locationsFieldsMapping['schedule_every']].','; |
|
342 | + $curSchedule .= '"'.$mode.'":{'.'"every":'.$rows[$locationsFieldsMapping['schedule_every']].','; |
|
343 | 343 | if ($mode=='daily') { |
344 | - $curSchedule = trim($curSchedule,','); |
|
345 | - $curSchedule.='}'; |
|
344 | + $curSchedule = trim($curSchedule, ','); |
|
345 | + $curSchedule .= '}'; |
|
346 | 346 | } |
347 | 347 | } else { |
348 | 348 | array_push($results['fail'], "$iRow --> The parameter sched_every is not set"); |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | |
432 | 432 | $curSchedule = '[{'.$curSchedule.'}]'; |
433 | 433 | |
434 | - $oSchedule = json_decode($curSchedule,TRUE); |
|
434 | + $oSchedule = json_decode($curSchedule, TRUE); |
|
435 | 435 | |
436 | 436 | $parametersArray = array(); |
437 | 437 |
@@ -144,9 +144,9 @@ discard block |
||
144 | 144 | { |
145 | 145 | $optimizations = self::get(array('offset' => $offset, 'limit' => $limit)); |
146 | 146 | |
147 | - $rOptimization = $optimizations[rand(0,sizeof($optimizations)-1)]; |
|
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 { |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | return null; |
164 | 164 | } |
165 | 165 | |
166 | - $params = array("optimization_problem_id" => $opt_id ); |
|
166 | + $params = array("optimization_problem_id" => $opt_id); |
|
167 | 167 | |
168 | 168 | $optimization = (array)$this->get($params); |
169 | 169 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | return null; |
182 | 182 | } |
183 | 183 | |
184 | - $num = rand(0, sizeof($addresses)-1); |
|
184 | + $num = rand(0, sizeof($addresses) - 1); |
|
185 | 185 | |
186 | 186 | $rAddress = $addresses[$num]; |
187 | 187 |