@@ -40,7 +40,7 @@ |
||
| 40 | 40 | $field = $this->getField($_GET['field']); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - if (! isset($field)) { |
|
| 43 | + if (!isset($field)) { |
|
| 44 | 44 | return $this->respondWithError('Field wasn\'t provided and is required.', self::CODE_WRONG_ARGS); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -18,19 +18,19 @@ discard block |
||
| 18 | 18 | public function validateRequestVars() |
| 19 | 19 | { |
| 20 | 20 | try { |
| 21 | - if (! empty($_GET['field'])) { |
|
| 21 | + if (!empty($_GET['field'])) { |
|
| 22 | 22 | $this->parseField($_GET['field']); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - if (! empty($_GET['server'])) { |
|
| 25 | + if (!empty($_GET['server'])) { |
|
| 26 | 26 | $this->parseServer($_GET['server']); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - if (! empty($_GET['limit'])) { |
|
| 29 | + if (!empty($_GET['limit'])) { |
|
| 30 | 30 | $this->parseOffset($_GET['limit']); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - if (! empty($_GET['offset'])) { |
|
| 33 | + if (!empty($_GET['offset'])) { |
|
| 34 | 34 | $this->parseOffset($_GET['offset']); |
| 35 | 35 | } |
| 36 | 36 | } catch (InvalidArgumentException $e) { |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | 'captures' |
| 57 | 57 | ]; |
| 58 | 58 | |
| 59 | - if (! empty($field) && in_array($field, $validFields)) { |
|
| 59 | + if (!empty($field) && in_array($field, $validFields)) { |
|
| 60 | 60 | return $field; |
| 61 | 61 | } |
| 62 | 62 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | unset($validServers[$key]); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - if (! empty($server) && in_array($server, $validServers)) { |
|
| 80 | + if (!empty($server) && in_array($server, $validServers)) { |
|
| 81 | 81 | return $server; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function parseLimit($limit) |
| 93 | 93 | { |
| 94 | - if (! isset($limit) && ! is_numeric($limit)) { |
|
| 94 | + if (!isset($limit) && !is_numeric($limit)) { |
|
| 95 | 95 | throw new InvalidArgumentException("Limit needs to be in numerical format."); |
| 96 | 96 | } |
| 97 | 97 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | public function parseOffset($offset) |
| 105 | 105 | { |
| 106 | - if (! isset($offset) && ! is_numeric($offset)) { |
|
| 106 | + if (!isset($offset) && !is_numeric($offset)) { |
|
| 107 | 107 | throw new InvalidArgumentException("Offset needs to be in numerical format."); |
| 108 | 108 | } |
| 109 | 109 | |
@@ -93,16 +93,16 @@ discard block |
||
| 93 | 93 | $limit = (int) $_GET['limit']; |
| 94 | 94 | |
| 95 | 95 | // Set defaults if not supplied |
| 96 | - if (empty($offset) || ! is_numeric($offset)) { |
|
| 96 | + if (empty($offset) || !is_numeric($offset)) { |
|
| 97 | 97 | $offset = 0; |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - if (empty($limit) || ! is_numeric($limit)) { |
|
| 100 | + if (empty($limit) || !is_numeric($limit)) { |
|
| 101 | 101 | $limit = 50; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | // Check the date difference between two dates. we don't want to run queries for ALL OF ZE ALERTS NOW do we?! |
| 105 | - if (! empty($dates)) { |
|
| 105 | + if (!empty($dates)) { |
|
| 106 | 106 | try { |
| 107 | 107 | $this->getDateValidationUtility()->validateTimeDifference($dates, 180); // Allow half a year |
| 108 | 108 | } catch (InvalidArgumentException $e) { |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $query->where('ResultWinner IN (?)', $this->convertStringToArrayForAuraBinds($factions)); |
| 124 | 124 | $query->where('ResultTimeType IN (?)', $brackets); |
| 125 | 125 | |
| 126 | - if (! empty($dates)) { |
|
| 126 | + if (!empty($dates)) { |
|
| 127 | 127 | $this->addDateRangeWhereClause($dates, $query); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | $query->cols([$sql]); |
| 74 | 74 | |
| 75 | - if (! empty($dates)) { |
|
| 75 | + if (!empty($dates)) { |
|
| 76 | 76 | $this->addDateRangeWhereClause($dates, $query, true); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $query->cols([$sql]); |
| 179 | 179 | |
| 180 | 180 | $query->where('ResultDateTime IS NOT NULL'); |
| 181 | - if (! empty($dates)) { |
|
| 181 | + if (!empty($dates)) { |
|
| 182 | 182 | $this->addDateRangeWhereClause($dates, $query, true); |
| 183 | 183 | } |
| 184 | 184 | $query->groupBy(['dateIndex']); |
@@ -203,11 +203,11 @@ discard block |
||
| 203 | 203 | $factionAbv = strtoupper($faction); |
| 204 | 204 | |
| 205 | 205 | $sql .= "SUM(CASE WHEN `ResultWinner` = '{$factionAbv}' "; |
| 206 | - if (! empty($server)) { |
|
| 206 | + if (!empty($server)) { |
|
| 207 | 207 | $sql .= "AND `ResultServer` IN ({$server}) "; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - if (! empty($zones)) { |
|
| 210 | + if (!empty($zones)) { |
|
| 211 | 211 | $sql .= "AND `ResultAlertCont` IN ({$zones}) "; |
| 212 | 212 | } |
| 213 | 213 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $this->parsePlayerName($args['term']); |
| 48 | 48 | $players = $this->searchForPlayer($args['term']); |
| 49 | 49 | |
| 50 | - if (! empty($players)) { |
|
| 50 | + if (!empty($players)) { |
|
| 51 | 51 | return $this->respond( |
| 52 | 52 | 'collection', |
| 53 | 53 | $players, |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | $this->parseOutfitName($name); |
| 75 | 75 | |
| 76 | - if (! empty($outfits)) { |
|
| 76 | + if (!empty($outfits)) { |
|
| 77 | 77 | return $this->respond( |
| 78 | 78 | 'collection', |
| 79 | 79 | $outfits, |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | return $this->respondWithError('Player ID cannot be longer than 19 characters.', self::CODE_WRONG_ARGS); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - if (! is_numeric($id)) { |
|
| 189 | + if (!is_numeric($id)) { |
|
| 190 | 190 | return $this->respondWithError('Player ID must be numeric.', self::CODE_WRONG_ARGS); |
| 191 | 191 | } |
| 192 | 192 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | // Now return the character the outfit injected |
| 78 | - if (! empty($character['data']['outfit'])) { |
|
| 78 | + if (!empty($character['data']['outfit'])) { |
|
| 79 | 79 | try { |
| 80 | 80 | $outfit = $this->getOutfit($character['data']['outfit']); |
| 81 | 81 | } catch (CensusErrorException $e) { |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | // First, check if we have the character in Redis |
| 138 | 138 | $redisCheck = $this->getRedisUtility()->checkRedis('cache', 'character', $id); |
| 139 | 139 | |
| 140 | - if (! empty($redisCheck)) { |
|
| 140 | + if (!empty($redisCheck)) { |
|
| 141 | 141 | return $redisCheck; |
| 142 | 142 | } |
| 143 | 143 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | // First, check if we have the outfit in Redis |
| 187 | 187 | $redisCheck = $this->getRedisUtility()->checkRedis('cache', 'outfit', $id); |
| 188 | 188 | |
| 189 | - if (! empty($redisCheck)) { |
|
| 189 | + if (!empty($redisCheck)) { |
|
| 190 | 190 | return $redisCheck; |
| 191 | 191 | } |
| 192 | 192 | |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | ]; |
| 246 | 246 | |
| 247 | 247 | // Loop through each environment and get the first result |
| 248 | - foreach($environments as $env) { |
|
| 248 | + foreach ($environments as $env) { |
|
| 249 | 249 | $url = "https://census.daybreakgames.com/s:{$config['census_service_id']}/get/{$env}/{$endpoint}"; |
| 250 | 250 | |
| 251 | 251 | $req = $guzzle->request('GET', $url); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $alert = $this->alertRepo->readSingleById($id, 'primary', true); |
| 62 | 62 | |
| 63 | 63 | if (empty($force) && empty($alert)) { |
| 64 | - $output->writeln("ALERT {$id} DOES NOT EXIST!"); |
|
| 64 | + $output->writeln("alert {$id} DOES NOT EXIST!"); |
|
| 65 | 65 | return false; |
| 66 | 66 | } |
| 67 | 67 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $this->deleteAlert($id); |
| 107 | 107 | |
| 108 | 108 | if ($this->verbose === 1) { |
| 109 | - $output->writeln("Alert {$id} successfully deleted!"); |
|
| 109 | + $output->writeln("alert {$id} successfully deleted!"); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | return true; |
@@ -29,12 +29,12 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | public function validateTimeDifference($dates, int $maxDiff) |
| 31 | 31 | { |
| 32 | - if (! is_array($dates)) { |
|
| 32 | + if (!is_array($dates)) { |
|
| 33 | 33 | $dates = str_replace('\'', '', $dates); // Remove escaping quotes |
| 34 | 34 | $dates = explode(',', $dates); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - if (! is_array) { |
|
| 37 | + if (!is_array) { |
|
| 38 | 38 | throw new InvalidArgumentException('Somehow validateTimeDifference couldn\'t make a date array.'); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | protected $flag = 'NOT-USED'; |
| 13 | 13 | protected $misses = 0; |
| 14 | - protected $hits = 0; |
|
| 14 | + protected $hits = 0; |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Sets the Redis Missed Flag |