@@ -24,8 +24,7 @@ |
||
| 24 | 24 | if (is_array($value)) |
| 25 | 25 | { |
| 26 | 26 | Route4Me::simplePrint($value); |
| 27 | - } |
|
| 28 | - else |
|
| 27 | + } else |
|
| 29 | 28 | { |
| 30 | 29 | echo "$key => $value <br>"; |
| 31 | 30 | } |
@@ -32,7 +32,9 @@ |
||
| 32 | 32 | foreach ($routeResults['addresses'] as $key => $address) { |
| 33 | 33 | $araddress = (array)$address; |
| 34 | 34 | |
| 35 | - if (isset($araddress['route_destination_id'])) echo "route_destination_id=".$araddress['route_destination_id']."<br>"; |
|
| 35 | + if (isset($araddress['route_destination_id'])) { |
|
| 36 | + echo "route_destination_id=".$araddress['route_destination_id']."<br>"; |
|
| 37 | + } |
|
| 36 | 38 | |
| 37 | 39 | if (isset($araddress['path_to_next'])) { |
| 38 | 40 | echo "path_to_next:<br>"; |
@@ -198,7 +198,7 @@ |
||
| 198 | 198 | } else { |
| 199 | 199 | return $json; |
| 200 | 200 | } |
| 201 | - } elseif (409==$code) { |
|
| 201 | + } elseif (409==$code) { |
|
| 202 | 202 | throw new ApiError('Wrong API key'); |
| 203 | 203 | } else { |
| 204 | 204 | throw new ApiError('Something wrong'); |
@@ -258,14 +258,18 @@ discard block |
||
| 258 | 258 | { |
| 259 | 259 | $weekdays = explode(',', $scheduleWeekDays); |
| 260 | 260 | |
| 261 | - if (sizeof($weekdays)<1) return FALSE; |
|
| 261 | + if (sizeof($weekdays)<1) { |
|
| 262 | + return FALSE; |
|
| 263 | + } |
|
| 262 | 264 | |
| 263 | 265 | $isValid = TRUE; |
| 264 | 266 | |
| 265 | 267 | for ($i=0; $i<sizeof($weekdays); $i++) { |
| 266 | 268 | if (is_numeric($weekdays[$i])) { |
| 267 | 269 | $wday = intval($weekdays[$i]); |
| 268 | - if ($wday<1 || $wday>7) $isValid = FALSE; |
|
| 270 | + if ($wday<1 || $wday>7) { |
|
| 271 | + $isValid = FALSE; |
|
| 272 | + } |
|
| 269 | 273 | } else { |
| 270 | 274 | $isValid = FALSE; |
| 271 | 275 | } |
@@ -289,14 +293,18 @@ discard block |
||
| 289 | 293 | { |
| 290 | 294 | $monthlyDates = explode(',', $scheduleMonthlyDates); |
| 291 | 295 | |
| 292 | - if (sizeof($monthlyDates) <1) return FALSE; |
|
| 296 | + if (sizeof($monthlyDates) <1) { |
|
| 297 | + return FALSE; |
|
| 298 | + } |
|
| 293 | 299 | |
| 294 | 300 | $isValid = TRUE; |
| 295 | 301 | |
| 296 | 302 | for ($i=0; $i < sizeof($monthlyDates); $i++) { |
| 297 | 303 | if (is_numeric($monthlyDates[$i])) { |
| 298 | 304 | $mday = intval($monthlyDates[$i]); |
| 299 | - if ($mday <1 || $mday > 31) $isValid = FALSE; |
|
| 305 | + if ($mday <1 || $mday > 31) { |
|
| 306 | + $isValid = FALSE; |
|
| 307 | + } |
|
| 300 | 308 | } else { |
| 301 | 309 | $isValid = FALSE; |
| 302 | 310 | } |
@@ -307,7 +315,9 @@ discard block |
||
| 307 | 315 | |
| 308 | 316 | public static function validateScheduleNthN($scheduleNthN) |
| 309 | 317 | { |
| 310 | - if (!is_numeric($scheduleNthN)) return FALSE; |
|
| 318 | + if (!is_numeric($scheduleNthN)) { |
|
| 319 | + return FALSE; |
|
| 320 | + } |
|
| 311 | 321 | |
| 312 | 322 | $schedNthNs = array(1, 2, 3, 4, 5, -1); |
| 313 | 323 | |
@@ -320,7 +330,9 @@ discard block |
||
| 320 | 330 | |
| 321 | 331 | public static function validateScheduleNthWhat($scheduleNthWhat) |
| 322 | 332 | { |
| 323 | - if (!is_numeric($scheduleNthWhat)) return FALSE; |
|
| 333 | + if (!is_numeric($scheduleNthWhat)) { |
|
| 334 | + return FALSE; |
|
| 335 | + } |
|
| 324 | 336 | |
| 325 | 337 | $schedNthWhats = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); |
| 326 | 338 | |
@@ -70,8 +70,12 @@ |
||
| 70 | 70 | { |
| 71 | 71 | $terParams = array(); |
| 72 | 72 | |
| 73 | - if (isset($params->territory['type'])) $terParams['type'] = $params->territory['type']; |
|
| 74 | - if (isset($params->territory['data'])) $terParams['data'] = $params->territory['data']; |
|
| 73 | + if (isset($params->territory['type'])) { |
|
| 74 | + $terParams['type'] = $params->territory['type']; |
|
| 75 | + } |
|
| 76 | + if (isset($params->territory['data'])) { |
|
| 77 | + $terParams['data'] = $params->territory['data']; |
|
| 78 | + } |
|
| 75 | 79 | |
| 76 | 80 | $abContacts = Route4Me::makeRequst(array( |
| 77 | 81 | 'url' => Endpoint::AVOIDANCE_ZONE, |
@@ -327,8 +327,7 @@ |
||
| 327 | 327 | $orderResults = $order->addOrder($orderParameters); |
| 328 | 328 | |
| 329 | 329 | array_push($results['success'], "The order with order_id = ".strval($orderResults["order_id"])." added successfuly."); |
| 330 | - } |
|
| 331 | - else { |
|
| 330 | + } else { |
|
| 332 | 331 | array_push($results['fail'], "$iRow --> one of the parameters cached_lat, cached_lng, address_1 is not set"); |
| 333 | 332 | } |
| 334 | 333 | |
@@ -98,9 +98,15 @@ |
||
| 98 | 98 | |
| 99 | 99 | $vehicles = $this->getVehicles($params); |
| 100 | 100 | |
| 101 | - if (is_null($vehicles)) return null; |
|
| 102 | - if (!isset($vehicles['data'])) return null; |
|
| 103 | - if (sizeof($vehicles['data'])<1) return null; |
|
| 101 | + if (is_null($vehicles)) { |
|
| 102 | + return null; |
|
| 103 | + } |
|
| 104 | + if (!isset($vehicles['data'])) { |
|
| 105 | + return null; |
|
| 106 | + } |
|
| 107 | + if (sizeof($vehicles['data'])<1) { |
|
| 108 | + return null; |
|
| 109 | + } |
|
| 104 | 110 | |
| 105 | 111 | $randomIndex = rand(0, sizeof($vehicles['data'])-1); |
| 106 | 112 | |