@@ -65,14 +65,14 @@ |
||
65 | 65 | |
66 | 66 | public function __construct(array $links = null, array $meta = null) |
67 | 67 | { |
68 | - if ($links !== null && is_array($links)) { |
|
68 | + if ($links!==null && is_array($links)) { |
|
69 | 69 | $this->url_of_first_page = Common::getValue($links, 'first'); |
70 | 70 | $this->url_of_last_page = Common::getValue($links, 'last'); |
71 | 71 | $this->url_of_previous_page = Common::getValue($links, 'prev'); |
72 | 72 | $this->url_of_next_page = Common::getValue($links, 'next'); |
73 | 73 | } |
74 | 74 | |
75 | - if ($meta !== null && is_array($meta)) { |
|
75 | + if ($meta!==null && is_array($meta)) { |
|
76 | 76 | $this->number_of_current_page = Common::getValue($meta, 'current_page'); |
77 | 77 | $this->number_of_last_page = Common::getValue($meta, 'last_page'); |
78 | 78 | $this->items_per_page = Common::getValue($meta, 'per_page'); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | public function getSchedule(string $scheduleId) : Schedule |
68 | 68 | { |
69 | 69 | return $this->toSchedule(Route4Me::makeRequst([ |
70 | - 'url' => Endpoint::RECURRING_ROUTES_SCHEDULES . '/' . $scheduleId, |
|
70 | + 'url' => Endpoint::RECURRING_ROUTES_SCHEDULES.'/'.$scheduleId, |
|
71 | 71 | 'method' => 'GET' |
72 | 72 | ])); |
73 | 73 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | 'advance_interval', 'advance_schedule_interval_days', 'schedule', 'timezone']; |
164 | 164 | |
165 | 165 | return $this->toSchedule(Route4Me::makeRequst([ |
166 | - 'url' => Endpoint::RECURRING_ROUTES_SCHEDULES . '/' . $scheduleId, |
|
166 | + 'url' => Endpoint::RECURRING_ROUTES_SCHEDULES.'/'.$scheduleId, |
|
167 | 167 | 'method' => 'PUT', |
168 | 168 | 'HTTPHEADER' => 'Content-Type: application/json', |
169 | 169 | 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | public function deleteSchedule(string $scheduleId, bool $withRoutes = false) : Schedule |
186 | 186 | { |
187 | 187 | return $this->toSchedule(Route4Me::makeRequst([ |
188 | - 'url' => Endpoint::RECURRING_ROUTES_SCHEDULES . '/' . $scheduleId, |
|
188 | + 'url' => Endpoint::RECURRING_ROUTES_SCHEDULES.'/'.$scheduleId, |
|
189 | 189 | 'method' => 'DELETE', |
190 | 190 | 'query' => ['with_routes' => $withRoutes] |
191 | 191 | ])); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | public function getRouteSchedule(string $route_id) : RouteSchedule |
229 | 229 | { |
230 | 230 | return $this->toRouteSchedule(Route4Me::makeRequst([ |
231 | - 'url' => Endpoint::RECURRING_ROUTES_ROUTE_SCHEDULES . '/' . $route_id, |
|
231 | + 'url' => Endpoint::RECURRING_ROUTES_ROUTE_SCHEDULES.'/'.$route_id, |
|
232 | 232 | 'method' => 'GET' |
233 | 233 | ])); |
234 | 234 | } |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | $allBodyFields = ['schedule_uid', 'member_id', 'vehicle_id']; |
318 | 318 | |
319 | 319 | return $this->toRouteSchedule(Route4Me::makeRequst([ |
320 | - 'url' => Endpoint::RECURRING_ROUTES_ROUTE_SCHEDULES . '/' . $route_id, |
|
320 | + 'url' => Endpoint::RECURRING_ROUTES_ROUTE_SCHEDULES.'/'.$route_id, |
|
321 | 321 | 'method' => 'PUT', |
322 | 322 | 'HTTPHEADER' => 'Content-Type: application/json', |
323 | 323 | 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
@@ -337,10 +337,10 @@ discard block |
||
337 | 337 | public function deleteRouteSchedules(string $route_id) : bool |
338 | 338 | { |
339 | 339 | $result = Route4Me::makeRequst([ |
340 | - 'url' => Endpoint::RECURRING_ROUTES_ROUTE_SCHEDULES . '/' . $route_id, |
|
340 | + 'url' => Endpoint::RECURRING_ROUTES_ROUTE_SCHEDULES.'/'.$route_id, |
|
341 | 341 | 'method' => 'DELETE' |
342 | 342 | ]); |
343 | - return ($result == 1 ? true : false); |
|
343 | + return ($result==1 ? true : false); |
|
344 | 344 | } |
345 | 345 | |
346 | 346 | /** |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | public function deleteRouteSchedule(string $route_id) : RouteSchedule |
356 | 356 | { |
357 | 357 | return $this->toRouteSchedule(Route4Me::makeRequst([ |
358 | - 'url' => Endpoint::RECURRING_ROUTES_ROUTE_SCHEDULES . '/' . $route_id . '/items', |
|
358 | + 'url' => Endpoint::RECURRING_ROUTES_ROUTE_SCHEDULES.'/'.$route_id.'/items', |
|
359 | 359 | 'method' => 'DELETE' |
360 | 360 | ])); |
361 | 361 | } |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | 'advance_interval', 'advance_schedule_interval_days', 'schedule', 'timezone']; |
387 | 387 | |
388 | 388 | return $this->toRouteSchedule(Route4Me::makeRequst([ |
389 | - 'url' => Endpoint::RECURRING_ROUTES_ROUTE_SCHEDULES_REPLACE . '/' . $route_id, |
|
389 | + 'url' => Endpoint::RECURRING_ROUTES_ROUTE_SCHEDULES_REPLACE.'/'.$route_id, |
|
390 | 390 | 'method' => 'PUT', |
391 | 391 | 'HTTPHEADER' => 'Content-Type: application/json', |
392 | 392 | 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | public function getRouteSchedulePreview(string $route_id, string $start, string $end) : array |
408 | 408 | { |
409 | 409 | return Route4Me::makeRequst([ |
410 | - 'url' => Endpoint::RECURRING_ROUTES_ROUTE_SCHEDULES . '/' . $route_id . '/preview', |
|
410 | + 'url' => Endpoint::RECURRING_ROUTES_ROUTE_SCHEDULES.'/'.$route_id.'/preview', |
|
411 | 411 | 'method' => 'GET', |
412 | 412 | 'query' => ['start' => $start, 'end' => $end] |
413 | 413 | ]); |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | public function isScheduledRouteCopy(string $route_id) : bool |
427 | 427 | { |
428 | 428 | return Route4Me::makeRequst([ |
429 | - 'url' => Endpoint::RECURRING_ROUTES_SCHEDULED_ROUTES_IS_COPY . '/' . $route_id, |
|
429 | + 'url' => Endpoint::RECURRING_ROUTES_SCHEDULED_ROUTES_IS_COPY.'/'.$route_id, |
|
430 | 430 | 'method' => 'GET' |
431 | 431 | ]); |
432 | 432 | } |
@@ -26,5 +26,5 @@ |
||
26 | 26 | |
27 | 27 | print_r($schedule); |
28 | 28 | } catch (\Exception $e) { |
29 | - echo $e->getMessage() . PHP_EOL; |
|
29 | + echo $e->getMessage().PHP_EOL; |
|
30 | 30 | } |
@@ -26,5 +26,5 @@ |
||
26 | 26 | |
27 | 27 | print_r($schedule); |
28 | 28 | } catch (\Exception $e) { |
29 | - echo $e->getMessage() . PHP_EOL; |
|
29 | + echo $e->getMessage().PHP_EOL; |
|
30 | 30 | } |
@@ -26,5 +26,5 @@ |
||
26 | 26 | |
27 | 27 | print_r($schedule); |
28 | 28 | } catch (\Exception $e) { |
29 | - echo $e->getMessage() . PHP_EOL; |
|
29 | + echo $e->getMessage().PHP_EOL; |
|
30 | 30 | } |
@@ -26,5 +26,5 @@ |
||
26 | 26 | |
27 | 27 | print_r($schedule); |
28 | 28 | } catch (\Exception $e) { |
29 | - echo $e->getMessage() . PHP_EOL; |
|
29 | + echo $e->getMessage().PHP_EOL; |
|
30 | 30 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | |
36 | 36 | public function __construct(?array $params = null) |
37 | 37 | { |
38 | - if ($params !== null) { |
|
38 | + if ($params!==null) { |
|
39 | 39 | $this->fillFromArray($params); |
40 | 40 | } |
41 | 41 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | { |
35 | 35 | $method = isset($options['method']) ? $options['method'] : 'GET'; |
36 | 36 | $query = isset($options['query']) |
37 | - ? array_filter($options['query'], function ($x) { |
|
37 | + ? array_filter($options['query'], function($x) { |
|
38 | 38 | return !is_null($x); |
39 | 39 | }) : []; |
40 | 40 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $ch = curl_init(); |
58 | 58 | |
59 | 59 | $url = isset($options['url']) |
60 | - ? $options['url'] . '?' . http_build_query(array_merge( |
|
60 | + ? $options['url'].'?'.http_build_query(array_merge( |
|
61 | 61 | $query, |
62 | 62 | ['api_key' => self::getApiKey()] |
63 | 63 | )) : ''; |
@@ -76,9 +76,9 @@ discard block |
||
76 | 76 | |
77 | 77 | curl_setopt_array($ch, $curlOpts); |
78 | 78 | |
79 | - if (null != $file) { |
|
79 | + if (null!=$file) { |
|
80 | 80 | $cfile = new \CURLFile($file, '', ''); |
81 | - $body['strFilename']=$cfile; |
|
81 | + $body['strFilename'] = $cfile; |
|
82 | 82 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
83 | 83 | curl_setopt($ch, CURLOPT_POST, true); |
84 | 84 | curl_setopt($ch, CURLOPT_POSTFIELDS, $body); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | if (isset($body)) { |
99 | 99 | $bodyData = json_encode($body); |
100 | 100 | if (isset($options['HTTPHEADER'])) { |
101 | - if (strpos($options['HTTPHEADER'], 'multipart/form-data') > 0) { |
|
101 | + if (strpos($options['HTTPHEADER'], 'multipart/form-data')>0) { |
|
102 | 102 | $bodyData = $body; |
103 | 103 | } |
104 | 104 | } |
@@ -123,14 +123,14 @@ discard block |
||
123 | 123 | curl_close($ch); |
124 | 124 | |
125 | 125 | $json = null; |
126 | - if (strpos($result, '<?xml') > -1) { |
|
126 | + if (strpos($result, '<?xml')>-1) { |
|
127 | 127 | $xml = simplexml_load_string($result); |
128 | 128 | $json = self::object2array($xml); |
129 | 129 | } else { |
130 | 130 | $json = json_decode($result, true); |
131 | 131 | } |
132 | 132 | |
133 | - if (200 == $code) { |
|
133 | + if (200==$code) { |
|
134 | 134 | if (isset($json['errors'])) { |
135 | 135 | throw new ApiError(implode(', ', $json['errors']), $code, $result); |
136 | 136 | } else { |
@@ -142,16 +142,16 @@ discard block |
||
142 | 142 | if (isset($json['messages'])) { |
143 | 143 | $msg = ''; |
144 | 144 | foreach ($json['messages'] as $key => $value) { |
145 | - if ($msg !== '') { |
|
145 | + if ($msg!=='') { |
|
146 | 146 | $msg .= PHP_EOL; |
147 | 147 | } |
148 | - $msg .= $key . ': ' . implode(', ', $value); |
|
148 | + $msg .= $key.': '.implode(', ', $value); |
|
149 | 149 | } |
150 | 150 | throw new ApiError($msg, $code, $result); |
151 | 151 | } elseif (isset($json['errors'])) { |
152 | 152 | $msg = ''; |
153 | 153 | foreach ($json['errors'] as $key => $value) { |
154 | - if ($msg !== '') { |
|
154 | + if ($msg!=='') { |
|
155 | 155 | $msg .= PHP_EOL; |
156 | 156 | } |
157 | 157 | $msg .= $value; |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | if (is_object($result1)) { |
197 | 197 | if ($deepPrinting) { |
198 | 198 | echo "<br>$key1 ------><br>"; |
199 | - $oarray = (array) $result1; |
|
199 | + $oarray = (array)$result1; |
|
200 | 200 | self::simplePrint($oarray, true); |
201 | 201 | echo '------<br>'; |
202 | 202 | } else { |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | if (is_object($result)) { |
214 | 214 | if ($deepPrinting) { |
215 | 215 | echo "<br>$key ------><br>"; |
216 | - $oarray = (array) $result; |
|
216 | + $oarray = (array)$result; |
|
217 | 217 | self::simplePrint($oarray, true); |
218 | 218 | echo '------<br>'; |
219 | 219 | } else { |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | { |
438 | 438 | $vehicleProfile = new VehicleProfile(); |
439 | 439 | |
440 | - $vehProfileId = self::$createdVehicleProfiles[sizeof(self::$createdVehicleProfiles)-1]['vehicle_profile_id']; |
|
440 | + $vehProfileId = self::$createdVehicleProfiles[sizeof(self::$createdVehicleProfiles) - 1]['vehicle_profile_id']; |
|
441 | 441 | |
442 | 442 | $result = $vehicleProfile->removeVehicleProfile($vehProfileId); |
443 | 443 | |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | { |
455 | 455 | $vehicleProfile = new VehicleProfile(); |
456 | 456 | |
457 | - $vehProfileId = self::$createdVehicleProfiles[sizeof(self::$createdVehicleProfiles)-1]['vehicle_profile_id']; |
|
457 | + $vehProfileId = self::$createdVehicleProfiles[sizeof(self::$createdVehicleProfiles) - 1]['vehicle_profile_id']; |
|
458 | 458 | |
459 | 459 | $result = $vehicleProfile->getVehicleProfileById($vehProfileId); |
460 | 460 | |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | { |
508 | 508 | $vehicle = new Vehicle(); |
509 | 509 | |
510 | - $vehicle->vehicle_alias = self::$createdVehicles[0]['vehicle_alias'] .' Updated'; |
|
510 | + $vehicle->vehicle_alias = self::$createdVehicles[0]['vehicle_alias'].' Updated'; |
|
511 | 511 | $vehicle->vehicle_vin = '11111111111111111'; |
512 | 512 | $vehicle->vehicle_id = self::$createdVehicles[0]['vehicle_id']; |
513 | 513 |