@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | if (isset($ablocations['results'])) { |
325 | 325 | $locationsSize = sizeof($ablocations['results']); |
326 | 326 | |
327 | - if ($locationsSize > 0) { |
|
327 | + if ($locationsSize>0) { |
|
328 | 328 | $randomLocationIndex = rand(0, $locationsSize - 1); |
329 | 329 | |
330 | 330 | return $ablocations['results'][$randomLocationIndex]; |
@@ -394,9 +394,9 @@ discard block |
||
394 | 394 | if (strtolower($scheduleEnabled)=="false") $scheduleEnabled = false; |
395 | 395 | } |
396 | 396 | |
397 | - $schedEnables = [true, false,]; |
|
397 | + $schedEnables = [true, false, ]; |
|
398 | 398 | |
399 | - if (in_array($scheduleEnabled, $schedEnables,true)) { |
|
399 | + if (in_array($scheduleEnabled, $schedEnables, true)) { |
|
400 | 400 | return true; |
401 | 401 | } else { |
402 | 402 | return false; |
@@ -423,18 +423,18 @@ discard block |
||
423 | 423 | $weekdays = explode(',', $scheduleWeekDays); |
424 | 424 | $weekdaysSize = sizeof($weekdays); |
425 | 425 | |
426 | - if ($weekdaysSize < 1) { |
|
426 | + if ($weekdaysSize<1) { |
|
427 | 427 | return false; |
428 | 428 | } |
429 | 429 | |
430 | 430 | $isValid = true; |
431 | 431 | |
432 | - for ($i = 0; $i < $weekdaysSize; ++$i) { |
|
432 | + for ($i = 0; $i<$weekdaysSize; ++$i) { |
|
433 | 433 | if (is_bool($weekdays[$i])) { |
434 | 434 | $isValid = false; |
435 | 435 | } elseif (is_numeric($weekdays[$i])) { |
436 | 436 | $wday = intval($weekdays[$i]); |
437 | - if ($wday < 1 || $wday > 7) { |
|
437 | + if ($wday<1 || $wday>7) { |
|
438 | 438 | $isValid = false; |
439 | 439 | } |
440 | 440 | } else { |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | { |
450 | 450 | $schedMonthlyMmodes = ['dates', 'nth']; |
451 | 451 | |
452 | - if (in_array($scheduleMonthlyMode, $schedMonthlyMmodes,true)) { |
|
452 | + if (in_array($scheduleMonthlyMode, $schedMonthlyMmodes, true)) { |
|
453 | 453 | return true; |
454 | 454 | } else { |
455 | 455 | return false; |
@@ -463,16 +463,16 @@ discard block |
||
463 | 463 | $monthlyDates = explode(',', $scheduleMonthlyDates); |
464 | 464 | $monthlyDatesSize = sizeof($monthlyDates); |
465 | 465 | |
466 | - if ($monthlyDatesSize < 1) { |
|
466 | + if ($monthlyDatesSize<1) { |
|
467 | 467 | return false; |
468 | 468 | } |
469 | 469 | |
470 | 470 | $isValid = true; |
471 | 471 | |
472 | - for ($i = 0; $i < $monthlyDatesSize; ++$i) { |
|
472 | + for ($i = 0; $i<$monthlyDatesSize; ++$i) { |
|
473 | 473 | if (is_numeric($monthlyDates[$i])) { |
474 | 474 | $mday = intval($monthlyDates[$i]); |
475 | - if ($mday < 1 || $mday > 31) { |
|
475 | + if ($mday<1 || $mday>31) { |
|
476 | 476 | $isValid = false; |
477 | 477 | } |
478 | 478 | } else { |
@@ -538,9 +538,9 @@ discard block |
||
538 | 538 | |
539 | 539 | $iRow = 1; |
540 | 540 | |
541 | - while (false !== ($rows = fgetcsv($csvFileHandle, $max_line_length, $delemietr))) { |
|
541 | + while (false!==($rows = fgetcsv($csvFileHandle, $max_line_length, $delemietr))) { |
|
542 | 542 | if (!isset($rows[$locationsFieldsMapping['cached_lat']]) || !isset($rows[$locationsFieldsMapping['cached_lng']]) |
543 | - || !isset($rows[$locationsFieldsMapping['address_1']]) || [null] == $rows) { |
|
543 | + || !isset($rows[$locationsFieldsMapping['address_1']]) || [null]==$rows) { |
|
544 | 544 | continue; |
545 | 545 | } |
546 | 546 | |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | if (isset($rows[$locationsFieldsMapping['schedule_every']])) { |
572 | 572 | if ($this->validateScheduleEvery($rows[$locationsFieldsMapping['schedule_every']])) { |
573 | 573 | $curSchedule .= '"'.$mode.'":{'.'"every":'.$rows[$locationsFieldsMapping['schedule_every']].','; |
574 | - if ('daily' == $mode) { |
|
574 | + if ('daily'==$mode) { |
|
575 | 575 | $curSchedule = trim($curSchedule, ','); |
576 | 576 | $curSchedule .= '}'; |
577 | 577 | } |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | } |
581 | 581 | } |
582 | 582 | |
583 | - if ('daily' != $mode) { |
|
583 | + if ('daily'!=$mode) { |
|
584 | 584 | switch ($mode) { |
585 | 585 | case 'weekly': |
586 | 586 | if (isset($rows[$locationsFieldsMapping['schedule_weekdays']])) { |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | array_push($results['fail'], "$iRow --> The parameter sched_monthly_mode is not set"); |
607 | 607 | } |
608 | 608 | |
609 | - if ('' != $monthlyMode) { |
|
609 | + if (''!=$monthlyMode) { |
|
610 | 610 | switch ($monthlyMode) { |
611 | 611 | case 'dates': |
612 | 612 | if (isset($rows[$locationsFieldsMapping['monthly_dates']])) { |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | array_push($results['fail'], "$iRow --> The parameter sched_nth_n is not set"); |
629 | 629 | } |
630 | 630 | |
631 | - if ('' != $curSchedule) { |
|
631 | + if (''!=$curSchedule) { |
|
632 | 632 | if (isset($rows[$locationsFieldsMapping['monthly_nth_what']])) { |
633 | 633 | if ($this->validateScheduleNthWhat($rows[$locationsFieldsMapping['monthly_nth_what']])) { |
634 | 634 | $curSchedule .= '"what":'.$rows[$locationsFieldsMapping['monthly_nth_what']].'}}'; |
@@ -649,11 +649,11 @@ discard block |
||
649 | 649 | } |
650 | 650 | } |
651 | 651 | |
652 | - if (sizeof($results['fail']) > $failCount) { |
|
652 | + if (sizeof($results['fail'])>$failCount) { |
|
653 | 653 | $curSchedule = ''; |
654 | 654 | } |
655 | 655 | |
656 | - if (('daily' == $mode || 'weekly' == $mode || 'monthy' == $mode) && '' == $curSchedule) { |
|
656 | + if (('daily'==$mode || 'weekly'==$mode || 'monthy'==$mode) && ''==$curSchedule) { |
|
657 | 657 | ++$iRow; |
658 | 658 | continue; |
659 | 659 | } |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | if (is_null($result) || !is_array($result)) return null; |
182 | 182 | |
183 | 183 | foreach ($result as $custNoteType) { |
184 | - if (isset($custNoteType["note_custom_type"]) && $custNoteType["note_custom_type"] == $params) { |
|
184 | + if (isset($custNoteType["note_custom_type"]) && $custNoteType["note_custom_type"]==$params) { |
|
185 | 185 | return $custNoteType; |
186 | 186 | } |
187 | 187 | } |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | $customArray = []; |
228 | 228 | |
229 | 229 | foreach ($params as $key => $value) { |
230 | - if (false !== strpos($key, 'custom_note_type')) { |
|
230 | + if (false!==strpos($key, 'custom_note_type')) { |
|
231 | 231 | $customArray[$key] = $value; |
232 | 232 | } |
233 | 233 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | // Initialize cURL request headers |
57 | - if (0 == sizeof($this->_headers)) { |
|
57 | + if (0==sizeof($this->_headers)) { |
|
58 | 58 | $this->_headers = [ |
59 | 59 | 'MyQApplicationId' => $this->appId, |
60 | 60 | 'Culture' => $this->culture, |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $error[] = 'password'; |
99 | 99 | } |
100 | 100 | |
101 | - if (sizeof($error) > 0) { |
|
101 | + if (sizeof($error)>0) { |
|
102 | 102 | throw new MyQException('Missing required auth credential: '.implode(',', $error)); |
103 | 103 | } |
104 | 104 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $this->_locationName, |
114 | 114 | $this->_doorName, |
115 | 115 | $this->_doorState, |
116 | - (int) $timeInState, |
|
116 | + (int)$timeInState, |
|
117 | 117 | ]); |
118 | 118 | } |
119 | 119 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | $data = json_decode($output); |
172 | 172 | |
173 | - if (false == $data || !isset($data->SecurityToken)) { |
|
173 | + if (false==$data || !isset($data->SecurityToken)) { |
|
174 | 174 | throw new MyQException("Error processing login request: $output"); |
175 | 175 | } |
176 | 176 | |
@@ -190,16 +190,16 @@ discard block |
||
190 | 190 | |
191 | 191 | $data = json_decode($output); |
192 | 192 | |
193 | - if (false == $data || !isset($data->Devices)) { |
|
193 | + if (false==$data || !isset($data->Devices)) { |
|
194 | 194 | throw new MyQException("Error fetching device details: $output"); |
195 | 195 | } |
196 | 196 | |
197 | 197 | // Find our door device ID |
198 | 198 | foreach ($data->Devices as $device) { |
199 | - if (false !== stripos($device->MyQDeviceTypeName, 'Gateway')) { |
|
199 | + if (false!==stripos($device->MyQDeviceTypeName, 'Gateway')) { |
|
200 | 200 | // Find location name |
201 | 201 | foreach ($device->Attributes as $attr) { |
202 | - if ('desc' == $attr->AttributeDisplayName) { |
|
202 | + if ('desc'==$attr->AttributeDisplayName) { |
|
203 | 203 | $this->_locationName = $attr->Value; |
204 | 204 | } |
205 | 205 | } |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | case 'doorstate': |
216 | 216 | $this->_doorState = $attr->Value; |
217 | 217 | // UpdatedTime is a timestamp in ms, so we truncate |
218 | - $this->_doorStateTime = (int) $attr->UpdatedTime / 1000; |
|
218 | + $this->_doorStateTime = (int)$attr->UpdatedTime / 1000; |
|
219 | 219 | break; |
220 | 220 | default: |
221 | 221 | continue; |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | // set multipart form data - file array field-value pairs |
287 | 287 | if (!empty($file_field_array)) { |
288 | 288 | foreach ($file_field_array as $var_name => $var_value) { |
289 | - if (false !== strpos(PHP_OS, 'WIN')) { |
|
289 | + if (false!==strpos(PHP_OS, 'WIN')) { |
|
290 | 290 | $var_value = str_replace('/', '\\', $var_value); |
291 | 291 | } // win hack |
292 | 292 | $file_field_array[$var_name] = '@'.$var_value; |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | static $curl_loops = 0; |
390 | 390 | static $curl_max_loops = 20; |
391 | 391 | |
392 | - if ($curl_loops++ >= $curl_max_loops) { |
|
392 | + if ($curl_loops++>=$curl_max_loops) { |
|
393 | 393 | $curl_loops = 0; |
394 | 394 | |
395 | 395 | return false; |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | //echo "*** Got HTTP code: $http_code ***\n"; |
408 | 408 | //echo "** Got headers: \n$header\n\n"; |
409 | 409 | |
410 | - if (301 == $http_code || 302 == $http_code) { |
|
410 | + if (301==$http_code || 302==$http_code) { |
|
411 | 411 | // If we're redirected, we should revert to GET |
412 | 412 | curl_setopt($ch, CURLOPT_HTTPGET, true); |
413 | 413 |
@@ -53,7 +53,7 @@ |
||
53 | 53 | /** @var string $geofence_polygon_shape |
54 | 54 | * Geofence polygon shape. ENUM('circle', 'poly', 'rect'). |
55 | 55 | */ |
56 | - public $geofence_polygon_shape ; |
|
56 | + public $geofence_polygon_shape; |
|
57 | 57 | |
58 | 58 | /** @var int $geofence_polygon_size |
59 | 59 | * Geofence polygon size |
@@ -163,13 +163,13 @@ |
||
163 | 163 | |
164 | 164 | foreach ($members['results'] as $memb) { |
165 | 165 | if (isset($memb['member_id']) && isset($memb['member_type'])) { |
166 | - if ($memberType == $memb['member_type']) { |
|
166 | + if ($memberType==$memb['member_type']) { |
|
167 | 167 | $memberIDs[] = $memb['member_id']; |
168 | 168 | } |
169 | 169 | } |
170 | 170 | } |
171 | 171 | |
172 | - if (sizeof($memberIDs) < 1) { |
|
172 | + if (sizeof($memberIDs)<1) { |
|
173 | 173 | return null; |
174 | 174 | } |
175 | 175 |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * An array of the AddressBookContact type objects. |
15 | 15 | * @var AddressBookLocation[] |
16 | 16 | */ |
17 | - public $results=[]; |
|
17 | + public $results = []; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * Total number of the returned contacts |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * An array of the field names to be shown |
27 | 27 | * @var string[] |
28 | 28 | */ |
29 | - public $fields=[]; |
|
29 | + public $fields = []; |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * The contacts query in the JSON format |
@@ -67,9 +67,9 @@ |
||
67 | 67 | const VEHICLE_V4_API = '/api.v4/vehicle.php'; |
68 | 68 | |
69 | 69 | const TELEMATICS_VENDORS = "http://telematics.route4me.com/api/vendors.php"; |
70 | - const TELEMATICS_REGISTER_MEMBER = "/api.v4/telematics/register.php"; |
|
71 | - const TELEMATICS_CONNECTION = "/api.v4/telematics/connections.php"; |
|
72 | - const TELEMATICS_VENDORS_INFO = "/api.v4/telematics/vendors.php"; |
|
70 | + const TELEMATICS_REGISTER_MEMBER = "/api.v4/telematics/register.php"; |
|
71 | + const TELEMATICS_CONNECTION = "/api.v4/telematics/connections.php"; |
|
72 | + const TELEMATICS_VENDORS_INFO = "/api.v4/telematics/vendors.php"; |
|
73 | 73 | |
74 | 74 | const MEMBER_CAPABILITIES = "/api/member/capabilities.php"; |
75 | 75 |
@@ -76,57 +76,57 @@ discard block |
||
76 | 76 | { |
77 | 77 | $route = new self(); |
78 | 78 | |
79 | - $route->route_id = Common::getValue($params, 'route_id'); |
|
80 | - $route->organization_id = Common::getValue($params, 'organization_id'); |
|
81 | - $route->route_progress = Common::getValue($params, 'route_progress'); |
|
82 | - $route->depot_address_id = Common::getValue($params, 'depot_address_id'); |
|
83 | - $route->root_member_id = Common::getValue($params, 'root_member_id'); |
|
84 | - $route->day_id = Common::getValue($params, 'day_id'); |
|
85 | - $route->addresses_visited_count = Common::getValue($params, 'addresses_visited_count'); |
|
86 | - $route->route_start_time = Common::getValue($params, 'route_start_time'); |
|
87 | - $route->route_end_time = Common::getValue($params, 'route_end_time'); |
|
88 | - $route->user_route_rating = Common::getValue($params, 'user_route_rating'); |
|
89 | - $route->member_id = Common::getValue($params, 'member_id'); |
|
90 | - $route->member_email = Common::getValue($params, 'member_email'); |
|
91 | - $route->member_first_name = Common::getValue($params, 'member_first_name'); |
|
92 | - $route->member_last_name = Common::getValue($params, 'member_last_name'); |
|
93 | - $route->channel_name = Common::getValue($params, 'channel_name'); |
|
94 | - $route->member_picture = Common::getValue($params, 'member_picture'); |
|
95 | - $route->member_tracking_subheadline = Common::getValue($params, 'member_tracking_subheadline'); |
|
96 | - $route->approved_for_execution = Common::getValue($params, 'approved_for_execution'); |
|
97 | - $route->approved_revisions_counter = Common::getValue($params, 'approved_revisions_counter'); |
|
98 | - $route->vehicle_alias = Common::getValue($params, 'vehicle_alias'); |
|
99 | - $route->driver_alias = Common::getValue($params, 'driver_alias'); |
|
100 | - $route->mpg = Common::getValue($params, 'mpg'); |
|
101 | - $route->trip_distance = Common::getValue($params, 'trip_distance'); |
|
102 | - $route->udu_distance_unit = Common::getValue($params, 'udu_distance_unit'); |
|
103 | - $route->udu_trip_distance = Common::getValue($params, 'udu_trip_distance'); |
|
104 | - $route->is_unrouted = Common::getValue($params, 'is_unrouted'); |
|
105 | - $route->gas_price = Common::getValue($params, 'gas_price'); |
|
106 | - $route->route_duration_sec = Common::getValue($params, 'route_duration_sec'); |
|
107 | - $route->planned_total_route_duration = Common::getValue($params, 'planned_total_route_duration'); |
|
108 | - $route->total_wait_time = Common::getValue($params, 'total_wait_time'); |
|
109 | - $route->udu_actual_travel_distance = Common::getValue($params, 'udu_actual_travel_distance'); |
|
110 | - $route->actual_travel_distance = Common::getValue($params, 'actual_travel_distance'); |
|
111 | - $route->actual_travel_time = Common::getValue($params, 'actual_travel_time'); |
|
112 | - $route->actual_footsteps = Common::getValue($params, 'actual_footsteps'); |
|
113 | - $route->working_time = Common::getValue($params, 'working_time'); |
|
114 | - $route->driving_time = Common::getValue($params, 'driving_time'); |
|
115 | - $route->idling_time = Common::getValue($params, 'idling_time'); |
|
116 | - $route->paying_miles = Common::getValue($params, 'paying_miles'); |
|
117 | - $route->geofence_polygon_type = Common::getValue($params, 'geofence_polygon_type'); |
|
118 | - $route->geofence_polygon_size = Common::getValue($params, 'geofence_polygon_size'); |
|
119 | - $route->destination_count = Common::getValue($params, 'destination_count'); |
|
120 | - $route->notes_count = Common::getValue($params, 'notes_count'); |
|
121 | - $route->notes = Common::getValue($params, 'notes'); |
|
122 | - $route->directions = Common::getValue($params, 'directions'); |
|
123 | - $route->path = Common::getValue($params, 'path'); |
|
124 | - $route->vehicle = Common::getValue($params, 'vehicle'); |
|
125 | - $route->member_config_storage = Common::getValue($params, 'member_config_storage'); |
|
126 | - $route->is_master = Common::getValue($params, 'is_master'); |
|
127 | - $route->bundle_items = Common::getValue($params, 'bundle_items'); |
|
128 | - $route->master_route_id = Common::getValue($params, 'master_route_id'); |
|
129 | - $route->route_status = Common::getValue($params, 'route_status'); |
|
79 | + $route->route_id = Common::getValue($params, 'route_id'); |
|
80 | + $route->organization_id = Common::getValue($params, 'organization_id'); |
|
81 | + $route->route_progress = Common::getValue($params, 'route_progress'); |
|
82 | + $route->depot_address_id = Common::getValue($params, 'depot_address_id'); |
|
83 | + $route->root_member_id = Common::getValue($params, 'root_member_id'); |
|
84 | + $route->day_id = Common::getValue($params, 'day_id'); |
|
85 | + $route->addresses_visited_count = Common::getValue($params, 'addresses_visited_count'); |
|
86 | + $route->route_start_time = Common::getValue($params, 'route_start_time'); |
|
87 | + $route->route_end_time = Common::getValue($params, 'route_end_time'); |
|
88 | + $route->user_route_rating = Common::getValue($params, 'user_route_rating'); |
|
89 | + $route->member_id = Common::getValue($params, 'member_id'); |
|
90 | + $route->member_email = Common::getValue($params, 'member_email'); |
|
91 | + $route->member_first_name = Common::getValue($params, 'member_first_name'); |
|
92 | + $route->member_last_name = Common::getValue($params, 'member_last_name'); |
|
93 | + $route->channel_name = Common::getValue($params, 'channel_name'); |
|
94 | + $route->member_picture = Common::getValue($params, 'member_picture'); |
|
95 | + $route->member_tracking_subheadline = Common::getValue($params, 'member_tracking_subheadline'); |
|
96 | + $route->approved_for_execution = Common::getValue($params, 'approved_for_execution'); |
|
97 | + $route->approved_revisions_counter = Common::getValue($params, 'approved_revisions_counter'); |
|
98 | + $route->vehicle_alias = Common::getValue($params, 'vehicle_alias'); |
|
99 | + $route->driver_alias = Common::getValue($params, 'driver_alias'); |
|
100 | + $route->mpg = Common::getValue($params, 'mpg'); |
|
101 | + $route->trip_distance = Common::getValue($params, 'trip_distance'); |
|
102 | + $route->udu_distance_unit = Common::getValue($params, 'udu_distance_unit'); |
|
103 | + $route->udu_trip_distance = Common::getValue($params, 'udu_trip_distance'); |
|
104 | + $route->is_unrouted = Common::getValue($params, 'is_unrouted'); |
|
105 | + $route->gas_price = Common::getValue($params, 'gas_price'); |
|
106 | + $route->route_duration_sec = Common::getValue($params, 'route_duration_sec'); |
|
107 | + $route->planned_total_route_duration = Common::getValue($params, 'planned_total_route_duration'); |
|
108 | + $route->total_wait_time = Common::getValue($params, 'total_wait_time'); |
|
109 | + $route->udu_actual_travel_distance = Common::getValue($params, 'udu_actual_travel_distance'); |
|
110 | + $route->actual_travel_distance = Common::getValue($params, 'actual_travel_distance'); |
|
111 | + $route->actual_travel_time = Common::getValue($params, 'actual_travel_time'); |
|
112 | + $route->actual_footsteps = Common::getValue($params, 'actual_footsteps'); |
|
113 | + $route->working_time = Common::getValue($params, 'working_time'); |
|
114 | + $route->driving_time = Common::getValue($params, 'driving_time'); |
|
115 | + $route->idling_time = Common::getValue($params, 'idling_time'); |
|
116 | + $route->paying_miles = Common::getValue($params, 'paying_miles'); |
|
117 | + $route->geofence_polygon_type = Common::getValue($params, 'geofence_polygon_type'); |
|
118 | + $route->geofence_polygon_size = Common::getValue($params, 'geofence_polygon_size'); |
|
119 | + $route->destination_count = Common::getValue($params, 'destination_count'); |
|
120 | + $route->notes_count = Common::getValue($params, 'notes_count'); |
|
121 | + $route->notes = Common::getValue($params, 'notes'); |
|
122 | + $route->directions = Common::getValue($params, 'directions'); |
|
123 | + $route->path = Common::getValue($params, 'path'); |
|
124 | + $route->vehicle = Common::getValue($params, 'vehicle'); |
|
125 | + $route->member_config_storage = Common::getValue($params, 'member_config_storage'); |
|
126 | + $route->is_master = Common::getValue($params, 'is_master'); |
|
127 | + $route->bundle_items = Common::getValue($params, 'bundle_items'); |
|
128 | + $route->master_route_id = Common::getValue($params, 'master_route_id'); |
|
129 | + $route->route_status = Common::getValue($params, 'route_status'); |
|
130 | 130 | |
131 | 131 | if (isset($params['vehicle'])) { |
132 | 132 | $route->vehicle = new Vehicle(); |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | { |
291 | 291 | $routeId = ""; |
292 | 292 | foreach ($routeIDs as $rid) { |
293 | - $routeId.=$rid.','; |
|
293 | + $routeId .= $rid.','; |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | $routeId = rtrim($routeId, ','); |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | |
395 | 395 | public function mergeRoutes($params) |
396 | 396 | { |
397 | - $allBodyFields = ['route_ids', 'depot_address', 'remove_origin', 'depot_lat', 'depot_lng']; |
|
397 | + $allBodyFields = ['route_ids', 'depot_address', 'remove_origin', 'depot_lat', 'depot_lng']; |
|
398 | 398 | |
399 | 399 | $result = Route4Me::makeRequst([ |
400 | 400 | 'url' => Endpoint::ROUTES_MERGE, |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | $route = new self(); |
434 | 434 | $routes = $route->getRoutes($params); |
435 | 435 | |
436 | - if (is_null($routes) || sizeof($routes) < 1) { |
|
436 | + if (is_null($routes) || sizeof($routes)<1) { |
|
437 | 437 | echo '<br> There are no routes in the account. Please, create the routes first. <br>'; |
438 | 438 | |
439 | 439 | return null; |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | |
447 | 447 | public function updateRoute($params) |
448 | 448 | { |
449 | - $allQueryFields = ['route_id', 'reoptimize','route_destination_id']; |
|
449 | + $allQueryFields = ['route_id', 'reoptimize', 'route_destination_id']; |
|
450 | 450 | $allBodyFields = ['addresses', 'parameters', 'unlink_from_master_optimization']; |
451 | 451 | |
452 | 452 | $result = Route4Me::makeRequst([ |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | |
481 | 481 | public function updateAddress($address = null) |
482 | 482 | { |
483 | - $body = sizeof($this->addresses) < 1 ? get_object_vars($this->parameters) |
|
483 | + $body = sizeof($this->addresses)<1 ? get_object_vars($this->parameters) |
|
484 | 484 | : (isset($this->addresses[0]) ? $this->addresses[0] : get_object_vars($this->parameters)); |
485 | 485 | |
486 | 486 | $result = Route4Me::makeRequst([ |