@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use League\Fractal\Manager; |
| 6 | 6 | use Ps2alerts\Api\Controller\Endpoint\AbstractEndpointController; |
| 7 | 7 | use Ps2alerts\Api\Repository\AlertRepository; |
| 8 | -use Ps2alerts\Api\Transformer\AlertTotalTransformer; |
|
| 9 | 8 | use Ps2alerts\Api\Transformer\AlertTransformer; |
| 10 | 9 | use Symfony\Component\HttpFoundation\Request; |
| 11 | 10 | use Symfony\Component\HttpFoundation\Response; |
@@ -93,11 +93,11 @@ |
||
| 93 | 93 | $limit = (int) $request->get('limit'); |
| 94 | 94 | |
| 95 | 95 | // Set defaults if not supplied |
| 96 | - if ($offset === null || ! is_numeric($offset)) { |
|
| 96 | + if ($offset === null || !is_numeric($offset)) { |
|
| 97 | 97 | $offset = 0; |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - if ($limit === null || ! is_numeric($limit)) { |
|
| 100 | + if ($limit === null || !is_numeric($limit)) { |
|
| 101 | 101 | $limit = 25; |
| 102 | 102 | } |
| 103 | 103 | |
@@ -24,8 +24,8 @@ |
||
| 24 | 24 | 'host' => $_ENV['REDIS_HOST'], |
| 25 | 25 | 'db' => $_ENV['REDIS_DB'] |
| 26 | 26 | ], |
| 27 | - 'servers' => [1,10,13,17,25,1000,2000], |
|
| 28 | - 'zones' => [2,4,6,8], |
|
| 29 | - 'factions' => ['vs','nc','tr','draw'], |
|
| 30 | - 'brackets' => ['MOR','AFT','PRI'] |
|
| 27 | + 'servers' => [1, 10, 13, 17, 25, 1000, 2000], |
|
| 28 | + 'zones' => [2, 4, 6, 8], |
|
| 29 | + 'factions' => ['vs', 'nc', 'tr', 'draw'], |
|
| 30 | + 'brackets' => ['MOR', 'AFT', 'PRI'] |
|
| 31 | 31 | ]; |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | { |
| 304 | 304 | $queryString = $request->query->get('embed'); |
| 305 | 305 | |
| 306 | - if (! empty($queryString)) { |
|
| 306 | + if (!empty($queryString)) { |
|
| 307 | 307 | $this->fractal->parseIncludes($request->query->get('embed')); |
| 308 | 308 | } |
| 309 | 309 | } |
@@ -324,14 +324,14 @@ discard block |
||
| 324 | 324 | $numericals = ['servers', 'zones']; |
| 325 | 325 | $strings = ['factions', 'brackets']; |
| 326 | 326 | |
| 327 | - if (! empty($queryString)) { |
|
| 327 | + if (!empty($queryString)) { |
|
| 328 | 328 | $check = explode(',', $queryString); |
| 329 | 329 | |
| 330 | 330 | // Run a check on the IDs provided to make sure they're valid and no naughty things are being passed |
| 331 | 331 | foreach ($check as $id) { |
| 332 | 332 | // If the query string should contain only numbers |
| 333 | 333 | if (in_array($mode, $numericals)) { |
| 334 | - if (! is_numeric($id)) { |
|
| 334 | + if (!is_numeric($id)) { |
|
| 335 | 335 | throw new InvalidArgumentException("Non numerical ID detected. Only numerical IDs are accepted with this request."); |
| 336 | 336 | } |
| 337 | 337 | } |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | } |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | - if (! in_array($id, $filters)) { |
|
| 344 | + if (!in_array($id, $filters)) { |
|
| 345 | 345 | throw new InvalidArgumentException("Unrecognized {$mode}. Please check the IDs you sent."); |
| 346 | 346 | } |
| 347 | 347 | } |
@@ -208,11 +208,11 @@ |
||
| 208 | 208 | foreach ($this->getConfigItem('factions') as $faction) { |
| 209 | 209 | $factionAbv = strtoupper($faction); |
| 210 | 210 | $sql .= "SUM(CASE WHEN `ResultWinner`='{$factionAbv}' "; |
| 211 | - if (! empty($server)) { |
|
| 211 | + if (!empty($server)) { |
|
| 212 | 212 | $sql .= "AND `ResultServer` IN ({$server}) "; |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | - if (! empty($zones)) { |
|
| 215 | + if (!empty($zones)) { |
|
| 216 | 216 | $sql .= "AND `ResultAlertCont` IN ({$zones}) "; |
| 217 | 217 | } |
| 218 | 218 | |