@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | /** |
16 | 16 | * Construct |
17 | 17 | * |
18 | - * @param Ps2alerts\Api\Repository\AlertRepository $repository |
|
19 | - * @param Ps2alerts\Api\Transformer\AlertTransformer $transformer |
|
20 | - * @param League\Fractal\Manager $fractal |
|
18 | + * @param AlertRepository $repository |
|
19 | + * @param AlertTransformer $transformer |
|
20 | + * @param Manager $fractal |
|
21 | 21 | */ |
22 | 22 | public function __construct( |
23 | 23 | AlertRepository $repository, |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | /** |
33 | 33 | * Returns a single alert's information |
34 | 34 | * |
35 | - * @param Symfony\Component\HttpFoundation\Request $request |
|
36 | - * @param Symfony\Component\HttpFoundation\Response $response |
|
35 | + * @param Request $request |
|
36 | + * @param Response $response |
|
37 | 37 | * @param array $args |
38 | 38 | * |
39 | - * @return \League\Fractal\TransformerAbstract |
|
39 | + * @return Response |
|
40 | 40 | */ |
41 | 41 | public function getSingle(Request $request, Response $response, array $args) |
42 | 42 | { |
@@ -52,10 +52,10 @@ discard block |
||
52 | 52 | /** |
53 | 53 | * Returns all currently running alerts |
54 | 54 | * |
55 | - * @param Symfony\Component\HttpFoundation\Request $request |
|
56 | - * @param Symfony\Component\HttpFoundation\Response $response |
|
55 | + * @param Request $request |
|
56 | + * @param Response $response |
|
57 | 57 | * |
58 | - * @return \League\Fractal\TransformerAbstract |
|
58 | + * @return Response |
|
59 | 59 | */ |
60 | 60 | public function getActives(Request $request, Response $response) |
61 | 61 | { |
@@ -71,10 +71,10 @@ discard block |
||
71 | 71 | /** |
72 | 72 | * Returns all alerts in historial order |
73 | 73 | * |
74 | - * @param Symfony\Component\HttpFoundation\Request $request |
|
75 | - * @param Symfony\Component\HttpFoundation\Response $response |
|
74 | + * @param Request $request |
|
75 | + * @param Response $response |
|
76 | 76 | * |
77 | - * @return \League\Fractal\TransformerAbstract |
|
77 | + * @return Response |
|
78 | 78 | */ |
79 | 79 | public function getHistoryByDate(Request $request, Response $response) |
80 | 80 | { |
@@ -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 | } |
@@ -342,7 +342,7 @@ |
||
342 | 342 | } |
343 | 343 | |
344 | 344 | if (! in_array($id, $filters)) { |
345 | - throw new InvalidArgumentException("Unrecognized {$mode}. Please check the IDs you sent."); |
|
345 | + throw new InvalidArgumentException("unrecognized {$mode}. Please check the IDs you sent."); |
|
346 | 346 | } |
347 | 347 | } |
348 | 348 |
@@ -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 |