@@ -16,9 +16,9 @@ discard block |
||
| 16 | 16 | /** |
| 17 | 17 | * Construct |
| 18 | 18 | * |
| 19 | - * @param Ps2alerts\Api\Repository\AlertRepository $repository |
|
| 20 | - * @param Ps2alerts\Api\Transformer\AlertTransformer $transformer |
|
| 21 | - * @param League\Fractal\Manager $fractal |
|
| 19 | + * @param AlertRepository $repository |
|
| 20 | + * @param AlertTransformer $transformer |
|
| 21 | + * @param Manager $fractal |
|
| 22 | 22 | */ |
| 23 | 23 | public function __construct( |
| 24 | 24 | AlertRepository $repository, |
@@ -33,10 +33,10 @@ discard block |
||
| 33 | 33 | /** |
| 34 | 34 | * Returns the victories of each faction and the totals |
| 35 | 35 | * |
| 36 | - * @param Psr\Http\Message\ServerRequestInterface $request |
|
| 37 | - * @param Psr\Http\Message\ResponseInterface $response |
|
| 36 | + * @param ServerRequestInterface $request |
|
| 37 | + * @param ResponseInterface $response |
|
| 38 | 38 | * |
| 39 | - * @return array |
|
| 39 | + * @return ResponseInterface |
|
| 40 | 40 | */ |
| 41 | 41 | public function getVictories(ServerRequestInterface $request, ResponseInterface $response) |
| 42 | 42 | { |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * @param \Psr\Http\Message\ServerRequestInterface $request |
| 50 | 50 | * @param \Psr\Http\Message\ResponseInterface $response |
| 51 | 51 | * |
| 52 | - * @return array |
|
| 52 | + * @return ResponseInterface |
|
| 53 | 53 | */ |
| 54 | 54 | public function getDominations(ServerRequestInterface $request, ResponseInterface $response) |
| 55 | 55 | { |
@@ -59,8 +59,6 @@ discard block |
||
| 59 | 59 | /** |
| 60 | 60 | * Gets the required count data and returns |
| 61 | 61 | * |
| 62 | - * @param \Psr\Http\Message\ServerRequestInterface $request |
|
| 63 | - * @param \Psr\Http\Message\ResponseInterface $response |
|
| 64 | 62 | * @param string $mode The type of data we're getting (victory / domination) |
| 65 | 63 | * |
| 66 | 64 | * @return \Psr\Http\Message\ResponseInterface |
@@ -209,11 +209,11 @@ |
||
| 209 | 209 | $factionAbv = strtoupper($faction); |
| 210 | 210 | |
| 211 | 211 | $sql .= "SUM(CASE WHEN `ResultWinner` = '{$factionAbv}' "; |
| 212 | - if (! empty($server)) { |
|
| 212 | + if (!empty($server)) { |
|
| 213 | 213 | $sql .= "AND `ResultServer` IN ({$server}) "; |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | - if (! empty($zones)) { |
|
| 216 | + if (!empty($zones)) { |
|
| 217 | 217 | $sql .= "AND `ResultAlertCont` IN ({$zones}) "; |
| 218 | 218 | } |
| 219 | 219 | |
@@ -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 Psr\Http\Message\ServerRequestInterface $request |
|
| 36 | - * @param Psr\Http\Message\ResponseInterface $response |
|
| 35 | + * @param ServerRequestInterface $request |
|
| 36 | + * @param ResponseInterface $response |
|
| 37 | 37 | * @param array $args |
| 38 | 38 | * |
| 39 | - * @return \League\Fractal\TransformerAbstract |
|
| 39 | + * @return ResponseInterface |
|
| 40 | 40 | */ |
| 41 | 41 | public function getSingle(ServerRequestInterface $request, ResponseInterface $response, array $args) |
| 42 | 42 | { |
@@ -56,10 +56,10 @@ discard block |
||
| 56 | 56 | /** |
| 57 | 57 | * Returns all currently running alerts |
| 58 | 58 | * |
| 59 | - * @param Psr\Http\Message\ServerRequestInterface $request |
|
| 60 | - * @param Psr\Http\Message\ResponseInterface $response |
|
| 59 | + * @param ServerRequestInterface $request |
|
| 60 | + * @param ResponseInterface $response |
|
| 61 | 61 | * |
| 62 | - * @return \League\Fractal\TransformerAbstract |
|
| 62 | + * @return ResponseInterface |
|
| 63 | 63 | */ |
| 64 | 64 | public function getActives(ServerRequestInterface $request, ResponseInterface $response) |
| 65 | 65 | { |
@@ -81,10 +81,10 @@ discard block |
||
| 81 | 81 | /** |
| 82 | 82 | * Returns all alerts in historial order |
| 83 | 83 | * |
| 84 | - * @param Psr\Http\Message\ServerRequestInterface $request |
|
| 85 | - * @param Psr\Http\Message\ResponseInterface $response |
|
| 84 | + * @param ServerRequestInterface $request |
|
| 85 | + * @param ResponseInterface $response |
|
| 86 | 86 | * |
| 87 | - * @return \League\Fractal\TransformerAbstract |
|
| 87 | + * @return ResponseInterface |
|
| 88 | 88 | */ |
| 89 | 89 | public function getHistoryByDate(ServerRequestInterface $request, ResponseInterface $response) |
| 90 | 90 | { |
@@ -153,10 +153,10 @@ discard block |
||
| 153 | 153 | /** |
| 154 | 154 | * Returns all alerts by latest |
| 155 | 155 | * |
| 156 | - * @param Psr\Http\Message\ServerRequestInterface $request |
|
| 157 | - * @param Psr\Http\Message\ResponseInterface $response |
|
| 156 | + * @param ServerRequestInterface $request |
|
| 157 | + * @param ResponseInterface $response |
|
| 158 | 158 | * |
| 159 | - * @return \League\Fractal\TransformerAbstract |
|
| 159 | + * @return ResponseInterface |
|
| 160 | 160 | */ |
| 161 | 161 | public function getLatest(ServerRequestInterface $request, ResponseInterface $response) |
| 162 | 162 | { |
@@ -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 Psr\Http\Message\ServerRequestInterface; |
| 11 | 10 | use Psr\Http\Message\ResponseInterface; |
@@ -103,11 +103,11 @@ discard block |
||
| 103 | 103 | $limit = (int) $_GET['limit']; |
| 104 | 104 | |
| 105 | 105 | // Set defaults if not supplied |
| 106 | - if (empty($offset) || ! is_numeric($offset)) { |
|
| 106 | + if (empty($offset) || !is_numeric($offset)) { |
|
| 107 | 107 | $offset = 0; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - if (empty($limit) || ! is_numeric($limit)) { |
|
| 110 | + if (empty($limit) || !is_numeric($limit)) { |
|
| 111 | 111 | $limit = 50; |
| 112 | 112 | } |
| 113 | 113 | |
@@ -173,11 +173,11 @@ discard block |
||
| 173 | 173 | $limit = (int) $_GET['limit']; |
| 174 | 174 | |
| 175 | 175 | // Set defaults if not supplied |
| 176 | - if (empty($offset) || ! is_numeric($offset)) { |
|
| 176 | + if (empty($offset) || !is_numeric($offset)) { |
|
| 177 | 177 | $offset = 0; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - if (empty($limit) || ! is_numeric($limit)) { |
|
| 180 | + if (empty($limit) || !is_numeric($limit)) { |
|
| 181 | 181 | $limit = 50; |
| 182 | 182 | } |
| 183 | 183 | |
@@ -15,9 +15,7 @@ |
||
| 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 Manager $fractal |
|
| 21 | 19 | */ |
| 22 | 20 | public function __construct( |
| 23 | 21 | Manager $fractal |
@@ -5,10 +5,7 @@ |
||
| 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 | -use Psr\Http\Message\ServerRequestInterface; |
|
| 11 | -use Psr\Http\Message\ResponseInterface; |
|
| 12 | 9 | |
| 13 | 10 | class ContextualDataEndpointController extends AbstractEndpointController |
| 14 | 11 | { |
@@ -22,6 +22,6 @@ |
||
| 22 | 22 | public function __construct( |
| 23 | 23 | Manager $fractal |
| 24 | 24 | ) { |
| 25 | - $this->fractal = $fractal; |
|
| 25 | + $this->fractal = $fractal; |
|
| 26 | 26 | } |
| 27 | 27 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | /** |
| 26 | 26 | * Construct |
| 27 | 27 | * |
| 28 | - * @param League\Fractal\Manager $fractal |
|
| 28 | + * @param Manager $fractal |
|
| 29 | 29 | */ |
| 30 | 30 | public function __construct( |
| 31 | 31 | Manager $fractal, |
@@ -38,11 +38,11 @@ discard block |
||
| 38 | 38 | /** |
| 39 | 39 | * Gets supplemental data |
| 40 | 40 | * |
| 41 | - * @param Psr\Http\Message\ServerRequestInterface $request |
|
| 42 | - * @param Psr\Http\Message\ResponseInterface $response |
|
| 41 | + * @param ServerRequestInterface $request |
|
| 42 | + * @param ResponseInterface $response |
|
| 43 | 43 | * @param array $args |
| 44 | 44 | * |
| 45 | - * @return \League\Fractal\TransformerAbstract |
|
| 45 | + * @return ResponseInterface |
|
| 46 | 46 | */ |
| 47 | 47 | public function getSupplementalData(ServerRequestInterface $request, ResponseInterface $response, array $args) |
| 48 | 48 | { |
@@ -57,11 +57,11 @@ discard block |
||
| 57 | 57 | /** |
| 58 | 58 | * Gets a player's info, either from redis or db cache |
| 59 | 59 | * |
| 60 | - * @param Psr\Http\Message\ServerRequestInterface $request |
|
| 61 | - * @param Psr\Http\Message\ResponseInterface $response |
|
| 60 | + * @param ServerRequestInterface $request |
|
| 61 | + * @param ResponseInterface $response |
|
| 62 | 62 | * @param array $args |
| 63 | 63 | * |
| 64 | - * @return \League\Fractal\TransformerAbstract |
|
| 64 | + * @return ResponseInterface |
|
| 65 | 65 | */ |
| 66 | 66 | public function character(ServerRequestInterface $request, ResponseInterface $response, array $args) |
| 67 | 67 | { |
@@ -102,11 +102,11 @@ discard block |
||
| 102 | 102 | /** |
| 103 | 103 | * Gets an outfits's info, either from redis or db cache |
| 104 | 104 | * |
| 105 | - * @param Psr\Http\Message\ServerRequestInterface $request |
|
| 106 | - * @param Psr\Http\Message\ResponseInterface $response |
|
| 105 | + * @param ServerRequestInterface $request |
|
| 106 | + * @param ResponseInterface $response |
|
| 107 | 107 | * @param array $args |
| 108 | 108 | * |
| 109 | - * @return \League\Fractal\TransformerAbstract |
|
| 109 | + * @return ResponseInterface |
|
| 110 | 110 | */ |
| 111 | 111 | public function outfit(ServerRequestInterface $request, ResponseInterface $response, array $args) |
| 112 | 112 | { |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | // Now return the character the outfit injected |
| 82 | - if (! empty($character['data']['outfit'])) { |
|
| 82 | + if (!empty($character['data']['outfit'])) { |
|
| 83 | 83 | try { |
| 84 | 84 | $outfit = $this->getOutfit($character['data']['outfit']); |
| 85 | 85 | } catch (CensusErrorException $e) { |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | // First, check if we have the character in Redis |
| 139 | 139 | $redisCheck = $this->checkRedis('cache', 'character', $id); |
| 140 | 140 | |
| 141 | - if (! empty($redisCheck)) { |
|
| 141 | + if (!empty($redisCheck)) { |
|
| 142 | 142 | return $redisCheck; |
| 143 | 143 | } |
| 144 | 144 | |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | // First, check if we have the outfit in Redis |
| 188 | 188 | $redisCheck = $this->checkRedis('cache', 'outfit', $id); |
| 189 | 189 | |
| 190 | - if (! empty($redisCheck)) { |
|
| 190 | + if (!empty($redisCheck)) { |
|
| 191 | 191 | return $redisCheck; |
| 192 | 192 | } |
| 193 | 193 | |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | ]; |
| 245 | 245 | |
| 246 | 246 | // Loop through each environment and get the first result |
| 247 | - foreach($environments as $env) { |
|
| 247 | + foreach ($environments as $env) { |
|
| 248 | 248 | $url = "https://census.daybreakgames.com/s:{$config['census_service_id']}/get/{$env}/{$endpoint}"; |
| 249 | 249 | |
| 250 | 250 | $req = $guzzle->request('GET', $url); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | /** |
| 24 | 24 | * Construct |
| 25 | 25 | * |
| 26 | - * @param League\Fractal\Manager $fractal |
|
| 26 | + * @param Manager $fractal |
|
| 27 | 27 | */ |
| 28 | 28 | public function __construct( |
| 29 | 29 | Manager $fractal, |
@@ -43,10 +43,10 @@ discard block |
||
| 43 | 43 | /** |
| 44 | 44 | * Get Player Leaderboard |
| 45 | 45 | * |
| 46 | - * @param Psr\Http\Message\ServerRequestInterface $request |
|
| 47 | - * @param Psr\Http\Message\ResponseInterface $response |
|
| 46 | + * @param ServerRequestInterface $request |
|
| 47 | + * @param ResponseInterface $response |
|
| 48 | 48 | * |
| 49 | - * @return League\Fractal\Manager |
|
| 49 | + * @return ResponseInterface |
|
| 50 | 50 | */ |
| 51 | 51 | public function players(ServerRequestInterface $request, ResponseInterface $response) |
| 52 | 52 | { |
@@ -136,10 +136,10 @@ discard block |
||
| 136 | 136 | /** |
| 137 | 137 | * Get Outfit Leaderboard |
| 138 | 138 | * |
| 139 | - * @param Psr\Http\Message\ServerRequestInterface $request |
|
| 140 | - * @param Psr\Http\Message\ResponseInterface $response |
|
| 139 | + * @param ServerRequestInterface $request |
|
| 140 | + * @param ResponseInterface $response |
|
| 141 | 141 | * |
| 142 | - * @return League\Fractal\Manager |
|
| 142 | + * @return ResponseInterface |
|
| 143 | 143 | */ |
| 144 | 144 | public function outfits(ServerRequestInterface $request, ResponseInterface $response) |
| 145 | 145 | { |
@@ -210,10 +210,10 @@ discard block |
||
| 210 | 210 | /** |
| 211 | 211 | * Get Weapon Leaderboard |
| 212 | 212 | * |
| 213 | - * @param Psr\Http\Message\ServerRequestInterface $request |
|
| 214 | - * @param Psr\Http\Message\ResponseInterface $response |
|
| 213 | + * @param ServerRequestInterface $request |
|
| 214 | + * @param ResponseInterface $response |
|
| 215 | 215 | * |
| 216 | - * @return League\Fractal\Manager |
|
| 216 | + * @return ResponseInterface |
|
| 217 | 217 | */ |
| 218 | 218 | public function weapons(ServerRequestInterface $request, ResponseInterface $response) |
| 219 | 219 | { |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | /** |
| 276 | 276 | * Validates the request variables |
| 277 | 277 | * |
| 278 | - * @param Psr\Http\Message\ServerRequestInterface $request |
|
| 278 | + * @param ServerRequestInterface $request |
|
| 279 | 279 | * |
| 280 | 280 | * @return boolean|InvalidArgumentException |
| 281 | 281 | */ |
@@ -11,7 +11,6 @@ |
||
| 11 | 11 | use Ps2alerts\Api\Repository\Metrics\OutfitTotalRepository; |
| 12 | 12 | use Ps2alerts\Api\Repository\Metrics\PlayerTotalRepository; |
| 13 | 13 | use Ps2alerts\Api\Repository\Metrics\WeaponTotalRepository; |
| 14 | -use Ps2alerts\Api\Transformer\Leaderboards\LeaderboardUpdatedTransformer; |
|
| 15 | 14 | use Ps2alerts\Api\Transformer\Leaderboards\OutfitLeaderboardTransformer; |
| 16 | 15 | use Ps2alerts\Api\Transformer\Leaderboards\PlayerLeaderboardTransformer; |
| 17 | 16 | use Ps2alerts\Api\Transformer\Leaderboards\WeaponLeaderboardTransformer; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - if (! isset($field)) { |
|
| 86 | + if (!isset($field)) { |
|
| 87 | 87 | return $this->errorWrongArgs('Field wasn\'t provided and is required.'); |
| 88 | 88 | } |
| 89 | 89 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | // Gets outfit details |
| 114 | 114 | for ($i = 0; $i < $count; $i++) { |
| 115 | - if (! empty($players[$i]['playerOutfit'])) { |
|
| 115 | + if (!empty($players[$i]['playerOutfit'])) { |
|
| 116 | 116 | // Gets outfit details |
| 117 | 117 | try { |
| 118 | 118 | $outfit = $this->dataEndpoint->getOutfit($players[$i]['playerOutfit']); |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - if (! isset($field)) { |
|
| 179 | + if (!isset($field)) { |
|
| 180 | 180 | return $this->errorWrongArgs('Field wasn\'t provided and is required.'); |
| 181 | 181 | } |
| 182 | 182 | |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | - if (! isset($field)) { |
|
| 242 | + if (!isset($field)) { |
|
| 243 | 243 | return $this->errorWrongArgs('Field wasn\'t provided and is required.'); |
| 244 | 244 | } |
| 245 | 245 | |
@@ -282,19 +282,19 @@ discard block |
||
| 282 | 282 | public function validateRequestVars($request) |
| 283 | 283 | { |
| 284 | 284 | try { |
| 285 | - if (! empty($_GET['field'])) { |
|
| 285 | + if (!empty($_GET['field'])) { |
|
| 286 | 286 | $this->parseField($_GET['field']); |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | - if (! empty($_GET['server'])) { |
|
| 289 | + if (!empty($_GET['server'])) { |
|
| 290 | 290 | $this->parseServer($_GET['server']); |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | - if (! empty($_GET['limit'])) { |
|
| 293 | + if (!empty($_GET['limit'])) { |
|
| 294 | 294 | $this->parseOffset($_GET['limit']); |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | - if (! empty($_GET['offset'])) { |
|
| 297 | + if (!empty($_GET['offset'])) { |
|
| 298 | 298 | $this->parseOffset($_GET['offset']); |
| 299 | 299 | } |
| 300 | 300 | } catch (InvalidArgumentException $e) { |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | 'captures' |
| 321 | 321 | ]; |
| 322 | 322 | |
| 323 | - if (! empty($field) && in_array($field, $validFields)) { |
|
| 323 | + if (!empty($field) && in_array($field, $validFields)) { |
|
| 324 | 324 | return $field; |
| 325 | 325 | } |
| 326 | 326 | |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | unset($validServers[$key]); |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | - if (! empty($server) && in_array($server, $validServers)) { |
|
| 344 | + if (!empty($server) && in_array($server, $validServers)) { |
|
| 345 | 345 | return $server; |
| 346 | 346 | } |
| 347 | 347 | |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | */ |
| 356 | 356 | public function parseLimit($limit) |
| 357 | 357 | { |
| 358 | - if (! isset($limit) && ! is_numeric($limit)) { |
|
| 358 | + if (!isset($limit) && !is_numeric($limit)) { |
|
| 359 | 359 | throw new InvalidArgumentException("Limit needs to be in numerical format."); |
| 360 | 360 | } |
| 361 | 361 | |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | */ |
| 368 | 368 | public function parseOffset($offset) |
| 369 | 369 | { |
| 370 | - if (! isset($offset) && ! is_numeric($offset)) { |
|
| 370 | + if (!isset($offset) && !is_numeric($offset)) { |
|
| 371 | 371 | throw new InvalidArgumentException("Offset needs to be in numerical format."); |
| 372 | 372 | } |
| 373 | 373 | |
@@ -29,10 +29,10 @@ discard block |
||
| 29 | 29 | /** |
| 30 | 30 | * Prompts the Leaderboard:Check command to resync the leaderboards |
| 31 | 31 | * |
| 32 | - * @param Psr\Http\Message\ServerRequestInterface $request |
|
| 33 | - * @param Psr\Http\Message\ResponseInterface $response |
|
| 32 | + * @param ServerRequestInterface $request |
|
| 33 | + * @param ResponseInterface $response |
|
| 34 | 34 | * |
| 35 | - * @return Symfony\Component\HttpFoundation\Response |
|
| 35 | + * @return ResponseInterface |
|
| 36 | 36 | */ |
| 37 | 37 | public function update(ServerRequestInterface $request, ResponseInterface $response) |
| 38 | 38 | { |
@@ -71,10 +71,10 @@ discard block |
||
| 71 | 71 | /** |
| 72 | 72 | * Returns a list of times that a server leaderboard has been updated |
| 73 | 73 | * |
| 74 | - * @param Psr\Http\Message\ServerRequestInterface $request |
|
| 75 | - * @param Psr\Http\Message\ResponseInterface $response |
|
| 74 | + * @param ServerRequestInterface $request |
|
| 75 | + * @param ResponseInterface $response |
|
| 76 | 76 | * |
| 77 | - * @return Symfony\Component\HttpFoundation\Response |
|
| 77 | + * @return ResponseInterface |
|
| 78 | 78 | */ |
| 79 | 79 | public function lastUpdate(ServerRequestInterface $request, ResponseInterface $response) |
| 80 | 80 | { |
@@ -2,10 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Ps2alerts\Api\Controller\Endpoint\Leaderboards; |
| 4 | 4 | |
| 5 | -use League\Fractal\Manager; |
|
| 6 | 5 | use Ps2alerts\Api\Controller\Endpoint\AbstractEndpointController; |
| 7 | -use Ps2alerts\Api\Repository\Metrics\OutfitTotalRepository; |
|
| 8 | -use Ps2alerts\Api\Repository\Metrics\PlayerTotalRepository; |
|
| 9 | 6 | use Psr\Http\Message\ServerRequestInterface; |
| 10 | 7 | use Psr\Http\Message\ResponseInterface; |
| 11 | 8 | |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | if ($redis->exists($key)) { |
| 56 | 56 | $data = json_decode($redis->get($key)); |
| 57 | 57 | |
| 58 | - // Ignore if already flagged as being updated |
|
| 58 | + // Ignore if already flagged as being updated |
|
| 59 | 59 | if ($data->beingUpdated == 0) { |
| 60 | 60 | $data->forceUpdate = 1; |
| 61 | 61 | $redis->set($key, json_encode($data)); |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | |
| 84 | 84 | $data = []; |
| 85 | 85 | |
| 86 | - foreach($config['servers'] as $server) { |
|
| 86 | + foreach ($config['servers'] as $server) { |
|
| 87 | 87 | $key = "ps2alerts:api:leaderboards:status:{$server}"; |
| 88 | 88 | |
| 89 | 89 | if ($redis->exists($key)) { |
@@ -14,9 +14,9 @@ discard block |
||
| 14 | 14 | /** |
| 15 | 15 | * Construct |
| 16 | 16 | * |
| 17 | - * @param League\Fractal\Manager $fractal |
|
| 18 | - * @param Ps2alerts\Api\Repository\Metrics\OutfitTotalRepository $outfitTotalRepo |
|
| 19 | - * @param Ps2alerts\Api\Transformer\Profiles\OutfitProfileTransformer $outfitProfileTransformer |
|
| 17 | + * @param Manager $fractal |
|
| 18 | + * @param OutfitTotalRepository $outfitTotalRepo |
|
| 19 | + * @param OutfitProfileTransformer $outfitProfileTransformer |
|
| 20 | 20 | */ |
| 21 | 21 | public function __construct( |
| 22 | 22 | Manager $fractal, |
@@ -31,11 +31,11 @@ discard block |
||
| 31 | 31 | /** |
| 32 | 32 | * Gets a outfit |
| 33 | 33 | * |
| 34 | - * @param Psr\Http\Message\ServerRequestInterface $request |
|
| 35 | - * @param Psr\Http\Message\ResponseInterface $response |
|
| 34 | + * @param ServerRequestInterface $request |
|
| 35 | + * @param ResponseInterface $response |
|
| 36 | 36 | * @param array $args |
| 37 | 37 | * |
| 38 | - * @return array |
|
| 38 | + * @return ResponseInterface |
|
| 39 | 39 | */ |
| 40 | 40 | public function getOutfit(ServerRequestInterface $request, ResponseInterface $response, array $args) |
| 41 | 41 | { |
@@ -14,9 +14,9 @@ discard block |
||
| 14 | 14 | /** |
| 15 | 15 | * Construct |
| 16 | 16 | * |
| 17 | - * @param League\Fractal\Manager $fractal |
|
| 18 | - * @param Ps2alerts\Api\Repository\Metrics\PlayerTotalRepository $playerTotalRepo |
|
| 19 | - * @param Ps2alerts\Api\Transformer\Profiles\PlayerProfileTransformer $playerProfileTransformer |
|
| 17 | + * @param Manager $fractal |
|
| 18 | + * @param PlayerTotalRepository $playerTotalRepo |
|
| 19 | + * @param PlayerProfileTransformer $playerProfileTransformer |
|
| 20 | 20 | */ |
| 21 | 21 | public function __construct( |
| 22 | 22 | Manager $fractal, |
@@ -31,11 +31,11 @@ discard block |
||
| 31 | 31 | /** |
| 32 | 32 | * Gets a player |
| 33 | 33 | * |
| 34 | - * @param Psr\Http\Message\ServerRequestInterface $request |
|
| 35 | - * @param Psr\Http\Message\ResponseInterface $response |
|
| 34 | + * @param ServerRequestInterface $request |
|
| 35 | + * @param ResponseInterface $response |
|
| 36 | 36 | * @param array $args |
| 37 | 37 | * |
| 38 | - * @return array |
|
| 38 | + * @return ResponseInterface |
|
| 39 | 39 | */ |
| 40 | 40 | public function getPlayer(ServerRequestInterface $request, ResponseInterface $response, array $args) |
| 41 | 41 | { |
@@ -17,11 +17,11 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * Construct |
| 19 | 19 | * |
| 20 | - * @param League\Fractal\Manager $fractal |
|
| 21 | - * @param Ps2alerts\Api\Transformer\Search\OutfitSearchTransformer $outfitSearchTransformer |
|
| 22 | - * @param Ps2alerts\Api\Repository\Metrics\OutfitTotalRepository $outfitTotalRepo |
|
| 23 | - * @param Ps2alerts\Api\Transformer\Search\PlayerSearchTransformer $playerSearchTransformer |
|
| 24 | - * @param Ps2alerts\Api\Repository\Metrics\PlayerTotalRepository $playerTotalRepo |
|
| 20 | + * @param Manager $fractal |
|
| 21 | + * @param OutfitSearchTransformer $outfitSearchTransformer |
|
| 22 | + * @param OutfitTotalRepository $outfitTotalRepo |
|
| 23 | + * @param PlayerSearchTransformer $playerSearchTransformer |
|
| 24 | + * @param PlayerTotalRepository $playerTotalRepo |
|
| 25 | 25 | */ |
| 26 | 26 | public function __construct( |
| 27 | 27 | Manager $fractal, |
@@ -40,11 +40,11 @@ discard block |
||
| 40 | 40 | /** |
| 41 | 41 | * Endpoint to return potential players based on search term |
| 42 | 42 | * |
| 43 | - * @param Psr\Http\Message\ServerRequestInterface $request |
|
| 44 | - * @param Psr\Http\Message\ResponseInterface $response |
|
| 43 | + * @param ServerRequestInterface $request |
|
| 44 | + * @param ResponseInterface $response |
|
| 45 | 45 | * @param array $args |
| 46 | 46 | * |
| 47 | - * @return \League\Fractal\TransformerAbstract |
|
| 47 | + * @return ResponseInterface|null |
|
| 48 | 48 | */ |
| 49 | 49 | public function getPlayersByTerm(ServerRequestInterface $request, ResponseInterface $response, array $args) |
| 50 | 50 | { |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | /** |
| 68 | 68 | * Endpoint to return potential players based on search term |
| 69 | 69 | * |
| 70 | - * @param Psr\Http\Message\ServerRequestInterface $request |
|
| 71 | - * @param Psr\Http\Message\ResponseInterface $response |
|
| 70 | + * @param ServerRequestInterface $request |
|
| 71 | + * @param ResponseInterface $response |
|
| 72 | 72 | * @param array $args |
| 73 | 73 | * |
| 74 | - * @return \League\Fractal\TransformerAbstract |
|
| 74 | + * @return ResponseInterface|null |
|
| 75 | 75 | */ |
| 76 | 76 | public function getOutfitsByTerm(ServerRequestInterface $request, ResponseInterface $response, array $args) |
| 77 | 77 | { |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use League\Fractal\Manager; |
| 6 | 6 | use Ps2alerts\Api\Controller\Endpoint\AbstractEndpointController; |
| 7 | -use Ps2alerts\Api\Exception\InvalidArgumentException; |
|
| 8 | 7 | use Ps2alerts\Api\Repository\Metrics\OutfitTotalRepository; |
| 9 | 8 | use Ps2alerts\Api\Repository\Metrics\PlayerTotalRepository; |
| 10 | 9 | use Ps2alerts\Api\Transformer\Search\OutfitSearchTransformer; |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | if ($this->parsePlayerName($args['term'], $response)) { |
| 53 | 53 | $players = $this->searchForPlayer($args['term']); |
| 54 | 54 | |
| 55 | - if (! empty($players)) { |
|
| 55 | + if (!empty($players)) { |
|
| 56 | 56 | return $this->respond( |
| 57 | 57 | 'collection', |
| 58 | 58 | $players, |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | if ($this->parseOutfitName($name, $response)) { |
| 82 | 82 | $outfits = $this->searchForOutfit($name); |
| 83 | 83 | |
| 84 | - if (! empty($outfits)) { |
|
| 84 | + if (!empty($outfits)) { |
|
| 85 | 85 | return $this->respond( |
| 86 | 86 | 'collection', |
| 87 | 87 | $outfits, |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | return $this->errorWrongArgs('Player ID cannot be longer than 19 characters.'); |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | - if (! is_numeric($id)) { |
|
| 202 | + if (!is_numeric($id)) { |
|
| 203 | 203 | return $this->errorWrongArgs('Player ID must be numeric.'); |
| 204 | 204 | } |
| 205 | 205 | |