@@ -235,13 +235,13 @@ discard block |
||
| 235 | 235 | switch ($key) { |
| 236 | 236 | case 'cached_lat': |
| 237 | 237 | case 'curbside_lat': |
| 238 | - if ($coord[$key] > 90 || $coord[$key] < -90) { |
|
| 238 | + if ($coord[$key]>90 || $coord[$key]<-90) { |
|
| 239 | 239 | return false; |
| 240 | 240 | } |
| 241 | 241 | break; |
| 242 | 242 | case 'cached_lng': |
| 243 | 243 | case 'curbside_lng': |
| 244 | - if ($coord[$key] > 180 || $coord[$key] < -180) { |
|
| 244 | + if ($coord[$key]>180 || $coord[$key]<-180) { |
|
| 245 | 245 | return false; |
| 246 | 246 | } |
| 247 | 247 | break; |
@@ -274,14 +274,14 @@ discard block |
||
| 274 | 274 | |
| 275 | 275 | $iRow = 1; |
| 276 | 276 | |
| 277 | - while (false !== ($rows = fgetcsv($csvFileHandle, $max_line_length, $delemietr))) { |
|
| 278 | - if ($rows[$ordersFieldsMapping['cached_lat']] && $rows[$ordersFieldsMapping['cached_lng']] && $rows[$ordersFieldsMapping['address_1']] && [null] !== $rows) { |
|
| 277 | + while (false!==($rows = fgetcsv($csvFileHandle, $max_line_length, $delemietr))) { |
|
| 278 | + if ($rows[$ordersFieldsMapping['cached_lat']] && $rows[$ordersFieldsMapping['cached_lng']] && $rows[$ordersFieldsMapping['address_1']] && [null]!==$rows) { |
|
| 279 | 279 | $cached_lat = 0.000; |
| 280 | 280 | $cached_lng = 0.000; |
| 281 | 281 | |
| 282 | 282 | foreach (['cached_lat', 'cached_lng', 'curbside_lat', 'curbside_lng'] as $coord) { |
| 283 | 283 | if (!$this->validateCoordinate([$coord => $rows[$ordersFieldsMapping[$coord]]])) { |
| 284 | - array_push($results['fail'], "$iRow --> Wrong " + $coord); |
|
| 284 | + array_push($results['fail'], "$iRow --> Wrong " +$coord); |
|
| 285 | 285 | ++$iRow; |
| 286 | 286 | continue; |
| 287 | 287 | } else { |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | public static function get($params) |
| 157 | 157 | { |
| 158 | 158 | $allQueryFields = ['state', 'limit', 'format', 'offset', |
| 159 | - 'optimization_problem_id', 'wait_for_final_state','start_date','end_date', ]; |
|
| 159 | + 'optimization_problem_id', 'wait_for_final_state', 'start_date', 'end_date', ]; |
|
| 160 | 160 | |
| 161 | 161 | $result = Route4Me::makeRequst([ |
| 162 | 162 | 'url' => Endpoint::OPTIMIZATION_PROBLEM, |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | $rOptimization = $optimizations[rand(0, sizeof($optimizations) - 1)]; |
| 244 | 244 | |
| 245 | 245 | if (!isset($rOptimization->optimization_problem_id)) { |
| 246 | - if (sizeof($optimizations) > 9) { |
|
| 246 | + if (sizeof($optimizations)>9) { |
|
| 247 | 247 | $this->getRandomOptimizationId($offset, $limit); |
| 248 | 248 | } else { |
| 249 | 249 | return null; |
@@ -255,13 +255,13 @@ discard block |
||
| 255 | 255 | |
| 256 | 256 | public function getAddresses($opt_id) |
| 257 | 257 | { |
| 258 | - if (null == $opt_id) { |
|
| 258 | + if (null==$opt_id) { |
|
| 259 | 259 | return null; |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | $params = ['optimization_problem_id' => $opt_id]; |
| 263 | 263 | |
| 264 | - $optimization = (array) $this->get($params); |
|
| 264 | + $optimization = (array)$this->get($params); |
|
| 265 | 265 | |
| 266 | 266 | $addresses = $optimization['addresses']; |
| 267 | 267 | |
@@ -270,9 +270,9 @@ discard block |
||
| 270 | 270 | |
| 271 | 271 | public function getRandomAddressFromOptimization($opt_id) |
| 272 | 272 | { |
| 273 | - $addresses = (array) $this->getAddresses($opt_id); |
|
| 273 | + $addresses = (array)$this->getAddresses($opt_id); |
|
| 274 | 274 | |
| 275 | - if (null == $addresses) { |
|
| 275 | + if (null==$addresses) { |
|
| 276 | 276 | echo 'There are no addresses in this optimization!.. Try again.'; |
| 277 | 277 | |
| 278 | 278 | return null; |
@@ -95,13 +95,13 @@ |
||
| 95 | 95 | * Telemetics connection vendor |
| 96 | 96 | * @var string |
| 97 | 97 | */ |
| 98 | - public $vendor ; |
|
| 98 | + public $vendor; |
|
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | 101 | * Telemetics connection type ID |
| 102 | 102 | * @var integer |
| 103 | 103 | */ |
| 104 | - public $vendor_id ; |
|
| 104 | + public $vendor_id; |
|
| 105 | 105 | |
| 106 | 106 | public static function fromArray(array $params) |
| 107 | 107 | { |
@@ -123,11 +123,11 @@ |
||
| 123 | 123 | $allVendors = self::GetTelematicsVendors(null); |
| 124 | 124 | $vendorsNumber = sizeof($allVendors['vendors']); |
| 125 | 125 | |
| 126 | - if ($vendorsNumber < $limit) { |
|
| 127 | - if ($vendorsNumber > $offset) { |
|
| 126 | + if ($vendorsNumber<$limit) { |
|
| 127 | + if ($vendorsNumber>$offset) { |
|
| 128 | 128 | $limit = $vendorsNumber; |
| 129 | 129 | } else { |
| 130 | - if ($vendorsNumber == $offset) { |
|
| 130 | + if ($vendorsNumber==$offset) { |
|
| 131 | 131 | return $allVendors['vendors'][$offset]->{'vendor_id'}; |
| 132 | 132 | } else { |
| 133 | 133 | echo 'The vendors numbers are less than offset'; |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | $vehicles = $this->getVehicles($params); |
| 112 | 112 | |
| 113 | - if (is_null($vehicles) || !isset($vehicles['data']) || sizeof($vehicles['data']) < 1) { |
|
| 113 | + if (is_null($vehicles) || !isset($vehicles['data']) || sizeof($vehicles['data'])<1) { |
|
| 114 | 114 | return null; |
| 115 | 115 | } |
| 116 | 116 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | public function getVehicleByID($vehicleID) |
| 123 | 123 | { |
| 124 | 124 | $response = Route4Me::makeRequst([ |
| 125 | - 'url' => Endpoint::VEHICLE_V4 . '/' . $vehicleID, |
|
| 125 | + 'url' => Endpoint::VEHICLE_V4.'/'.$vehicleID, |
|
| 126 | 126 | 'method' => 'GET', |
| 127 | 127 | ]); |
| 128 | 128 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $allBodyFields = Route4Me::getObjectProperties(new self(), ['vehicle_id']); |
| 137 | 137 | |
| 138 | 138 | $response = Route4Me::makeRequst([ |
| 139 | - 'url' => Endpoint::VEHICLE_V4 . '/' . $vehicleID, |
|
| 139 | + 'url' => Endpoint::VEHICLE_V4.'/'.$vehicleID, |
|
| 140 | 140 | 'method' => 'PUT', |
| 141 | 141 | 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
| 142 | 142 | 'HTTPHEADER' => 'Content-Type: application/json', |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $vehicleID = isset($params->vehicle_id) ? $params->vehicle_id : null; |
| 168 | 168 | |
| 169 | 169 | $response = Route4Me::makeRequst([ |
| 170 | - 'url' => Endpoint::VEHICLE_V4 . '/' . $vehicleID, |
|
| 170 | + 'url' => Endpoint::VEHICLE_V4.'/'.$vehicleID, |
|
| 171 | 171 | 'method' => 'DELETE', |
| 172 | 172 | 'HTTPHEADER' => 'Content-Type: application/json', |
| 173 | 173 | ]); |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | class UserLocation extends \Route4Me\Common |
| 11 | 11 | { |
| 12 | 12 | /** @var MemberData[] $member_data */ |
| 13 | - public $member_data=[]; |
|
| 13 | + public $member_data = []; |
|
| 14 | 14 | |
| 15 | 15 | /** @var UserTracking[] $tracking */ |
| 16 | 16 | public $tracking = []; |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | return $json; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - public static function getUserLocations($query=null) |
|
| 28 | + public static function getUserLocations($query = null) |
|
| 29 | 29 | { |
| 30 | 30 | $json = Route4Me\Route4Me::makeRequst([ |
| 31 | 31 | 'url' => Endpoint::USER_LOCATION, |
@@ -6,9 +6,9 @@ |
||
| 6 | 6 | |
| 7 | 7 | class AddressBookLocationSearchResponse |
| 8 | 8 | { |
| 9 | - public $results=[]; |
|
| 9 | + public $results = []; |
|
| 10 | 10 | public $total; |
| 11 | - public $fields=[]; |
|
| 11 | + public $fields = []; |
|
| 12 | 12 | |
| 13 | 13 | public static function fromArray(array $params) |
| 14 | 14 | { |
@@ -208,7 +208,7 @@ |
||
| 208 | 208 | ], |
| 209 | 209 | ]); |
| 210 | 210 | |
| 211 | - return (bool) $address['deleted']; |
|
| 211 | + return (bool)$address['deleted']; |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | public function moveDestinationToRoute($params) |