@@ -294,7 +294,9 @@ |
||
| 294 | 294 | |
| 295 | 295 | public static function tearDownAfterClass() |
| 296 | 296 | { |
| 297 | - if (sizeof(self::$createdTerritories)<1) return; |
|
| 297 | + if (sizeof(self::$createdTerritories)<1) { |
|
| 298 | + return; |
|
| 299 | + } |
|
| 298 | 300 | |
| 299 | 301 | $territory = new Territory(); |
| 300 | 302 | |
@@ -199,8 +199,7 @@ |
||
| 199 | 199 | |
| 200 | 200 | if ($result==true) { |
| 201 | 201 | echo "The test avoidance zone with territory_id=".$territoryId." removed. <br>"; |
| 202 | - } |
|
| 203 | - else { |
|
| 202 | + } else { |
|
| 204 | 203 | echo "Cannot remove the test avoidance zone with territory_id=".$territoryId."<br>"; |
| 205 | 204 | } |
| 206 | 205 | |
@@ -383,7 +383,9 @@ |
||
| 383 | 383 | |
| 384 | 384 | public function testValidateScheduleNthWhat() |
| 385 | 385 | { |
| 386 | - for ($i=1;$i<11;$i++) $this->assertTrue(AddressBookLocation::validateScheduleNthWhat($i)); |
|
| 386 | + for ($i=1;$i<11;$i++) { |
|
| 387 | + $this->assertTrue(AddressBookLocation::validateScheduleNthWhat($i)); |
|
| 388 | + } |
|
| 387 | 389 | |
| 388 | 390 | $this->assertFalse(AddressBookLocation::validateScheduleNthWhat(0)); |
| 389 | 391 | $this->assertFalse(AddressBookLocation::validateScheduleNthWhat(14)); |
@@ -59,7 +59,9 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | assert(is_array($duplicateResult1), "Cannot duplicate the route<br>"); |
| 61 | 61 | |
| 62 | -if (!$duplicateResult1['status'] || sizeof($duplicateResult1['route_ids'])<1) die("Cannot duplicate the route<br>"); |
|
| 62 | +if (!$duplicateResult1['status'] || sizeof($duplicateResult1['route_ids'])<1) { |
|
| 63 | + die("Cannot duplicate the route<br>"); |
|
| 64 | +} |
|
| 63 | 65 | |
| 64 | 66 | $duplicatedRouteId1 = $duplicateResult1['route_ids'][0]; |
| 65 | 67 | |
@@ -95,7 +97,9 @@ discard block |
||
| 95 | 97 | |
| 96 | 98 | assert(is_array($duplicateResult2), "Cannot duplicate the route<br>"); |
| 97 | 99 | |
| 98 | -if (!$duplicateResult2['status'] || sizeof($duplicateResult2['route_ids'])<1) die("Cannot duplicate the route<br>"); |
|
| 100 | +if (!$duplicateResult2['status'] || sizeof($duplicateResult2['route_ids'])<1) { |
|
| 101 | + die("Cannot duplicate the route<br>"); |
|
| 102 | +} |
|
| 99 | 103 | |
| 100 | 104 | $duplicatedRouteId2 = $duplicateResult2['route_ids'][0]; |
| 101 | 105 | |
@@ -390,8 +390,12 @@ discard block |
||
| 390 | 390 | public static function validateScheduleEnable($scheduleEnabled) |
| 391 | 391 | { |
| 392 | 392 | if (is_string($scheduleEnabled)) { |
| 393 | - if (strtolower($scheduleEnabled)=="true") $scheduleEnabled = true; |
|
| 394 | - if (strtolower($scheduleEnabled)=="false") $scheduleEnabled = false; |
|
| 393 | + if (strtolower($scheduleEnabled)=="true") { |
|
| 394 | + $scheduleEnabled = true; |
|
| 395 | + } |
|
| 396 | + if (strtolower($scheduleEnabled)=="false") { |
|
| 397 | + $scheduleEnabled = false; |
|
| 398 | + } |
|
| 395 | 399 | } |
| 396 | 400 | |
| 397 | 401 | $schedEnables = [true, false,]; |
@@ -418,7 +422,9 @@ discard block |
||
| 418 | 422 | |
| 419 | 423 | public static function validateScheduleWeekDays($scheduleWeekDays) |
| 420 | 424 | { |
| 421 | - if (is_bool($scheduleWeekDays)) return false; |
|
| 425 | + if (is_bool($scheduleWeekDays)) { |
|
| 426 | + return false; |
|
| 427 | + } |
|
| 422 | 428 | |
| 423 | 429 | $weekdays = explode(',', $scheduleWeekDays); |
| 424 | 430 | $weekdaysSize = sizeof($weekdays); |
@@ -458,7 +464,9 @@ discard block |
||
| 458 | 464 | |
| 459 | 465 | public static function validateScheduleMonthlyDates($scheduleMonthlyDates) |
| 460 | 466 | { |
| 461 | - if (is_bool($scheduleMonthlyDates)) return false; |
|
| 467 | + if (is_bool($scheduleMonthlyDates)) { |
|
| 468 | + return false; |
|
| 469 | + } |
|
| 462 | 470 | |
| 463 | 471 | $monthlyDates = explode(',', $scheduleMonthlyDates); |
| 464 | 472 | $monthlyDatesSize = sizeof($monthlyDates); |
@@ -178,7 +178,9 @@ |
||
| 178 | 178 | 'method' => 'GET', |
| 179 | 179 | ]); |
| 180 | 180 | |
| 181 | - if (is_null($result) || !is_array($result)) return null; |
|
| 181 | + if (is_null($result) || !is_array($result)) { |
|
| 182 | + return null; |
|
| 183 | + } |
|
| 182 | 184 | |
| 183 | 185 | foreach ($result as $custNoteType) { |
| 184 | 186 | if (isset($custNoteType["note_custom_type"]) && $custNoteType["note_custom_type"] == $params) { |
@@ -83,7 +83,9 @@ |
||
| 83 | 83 | $vehiclesResponse = new self(); |
| 84 | 84 | |
| 85 | 85 | foreach ($params as $key => $value) { |
| 86 | - if (is_null(Common::getValue($params, $key))) continue; |
|
| 86 | + if (is_null(Common::getValue($params, $key))) { |
|
| 87 | + continue; |
|
| 88 | + } |
|
| 87 | 89 | if (property_exists($vehiclesResponse, $key)) { |
| 88 | 90 | $vehiclesResponse->$key = $value; |
| 89 | 91 | } |
@@ -137,7 +137,9 @@ |
||
| 137 | 137 | $vehicleCreateResponse = new self(); |
| 138 | 138 | |
| 139 | 139 | foreach ($params as $key => $value) { |
| 140 | - if (is_null(Common::getValue($params, $key))) continue; |
|
| 140 | + if (is_null(Common::getValue($params, $key))) { |
|
| 141 | + continue; |
|
| 142 | + } |
|
| 141 | 143 | if (property_exists($vehicleCreateResponse, $key)) { |
| 142 | 144 | $vehicleCreateResponse->$key = $value; |
| 143 | 145 | } |
@@ -103,5 +103,7 @@ |
||
| 103 | 103 | echo "\tDistance: " . $route->trip_distance . PHP_EOL; |
| 104 | 104 | echo "\tAddresses:" . PHP_EOL; |
| 105 | 105 | |
| 106 | - foreach($route->addresses as $address) echo "\t\t" . $address->address . PHP_EOL; |
|
| 107 | -} |
|
| 106 | + foreach($route->addresses as $address) { |
|
| 107 | + echo "\t\t" . $address->address . PHP_EOL; |
|
| 108 | + } |
|
| 109 | + } |
|