| @@ -32,8 +32,8 @@ discard block | ||
| 32 | 32 | /** | 
| 33 | 33 | * Execution | 
| 34 | 34 | * | 
| 35 | - * @param Symfony\Component\Console\Input\InputInterface $input | |
| 36 | - * @param Symfony\Component\Console\Output\OutputInterface $output | |
| 35 | + * @param InputInterface $input | |
| 36 | + * @param OutputInterface $output | |
| 37 | 37 | * | 
| 38 | 38 | * @return void | 
| 39 | 39 | */ | 
| @@ -47,7 +47,7 @@ discard block | ||
| 47 | 47 | /** | 
| 48 | 48 | * Checks for alerts to be archived then runs routing against said alerts | 
| 49 | 49 | * | 
| 50 | - * @param Symfony\Component\Console\Output\OutputInterface $output | |
| 50 | + * @param OutputInterface $output | |
| 51 | 51 | * | 
| 52 | 52 | * @return void | 
| 53 | 53 | */ | 
| @@ -121,8 +121,8 @@ discard block | ||
| 121 | 121 | * Execution of routine | 
| 122 | 122 | * | 
| 123 | 123 | * @param array $alert | 
| 124 | - * @param array $tables | |
| 125 | - * @param Symfony\Component\Console\Output\OutputInterface $output | |
| 124 | + * @param string[] $tables | |
| 125 | + * @param OutputInterface $output | |
| 126 | 126 | * | 
| 127 | 127 | * @return void | 
| 128 | 128 | */ | 
| @@ -49,6 +49,10 @@ discard block | ||
| 49 | 49 | } | 
| 50 | 50 | } | 
| 51 | 51 | |
| 52 | + /** | |
| 53 | + * @param OutputInterface $output | |
| 54 | + * @param boolean $force | |
| 55 | + */ | |
| 52 | 56 | public function processAlert($id, $output, $force = null) | 
| 53 | 57 |      { | 
| 54 | 58 | $alert = $this->alertRepo->readSingleById($id, 'primary', true); | 
| @@ -183,6 +187,12 @@ discard block | ||
| 183 | 187 | ); | 
| 184 | 188 | } | 
| 185 | 189 | |
| 190 | + /** | |
| 191 | + * @param string $table | |
| 192 | + * @param string $totalsTable | |
| 193 | + * @param string $filter | |
| 194 | + * @param string[] $groupBy | |
| 195 | + */ | |
| 186 | 196 | protected function runProcess( | 
| 187 | 197 | $id, | 
| 188 | 198 | array $cols, | 
| @@ -18,8 +18,8 @@ | ||
| 18 | 18 |      { | 
| 19 | 19 | parent::configure(); // See BaseCommand.php | 
| 20 | 20 |          $this->setName('DeleteAlert') | 
| 21 | -             ->setDescription('Deletes an alert and corrects totals') | |
| 22 | - ->addArgument( | |
| 21 | +                ->setDescription('Deletes an alert and corrects totals') | |
| 22 | + ->addArgument( | |
| 23 | 23 | 'alert', | 
| 24 | 24 | InputArgument::REQUIRED, | 
| 25 | 25 | 'Alert ID to process' | 
| @@ -89,6 +89,10 @@ | ||
| 89 | 89 | } | 
| 90 | 90 | } | 
| 91 | 91 | |
| 92 | + /** | |
| 93 | + * @param integer $server | |
| 94 | + * @param OutputInterface $output | |
| 95 | + */ | |
| 92 | 96 |      public function update($server, $output) { | 
| 93 | 97 |          $output->writeln("Executing update for server: {$server}"); | 
| 94 | 98 | |
| @@ -16,7 +16,7 @@ | ||
| 16 | 16 |      { | 
| 17 | 17 | parent::configure(); // See BaseCommand.php | 
| 18 | 18 |          $this->setName('Leaderboards:Check') | 
| 19 | -             ->setDescription('Checks all leaderboards for updates'); | |
| 19 | +                ->setDescription('Checks all leaderboards for updates'); | |
| 20 | 20 | |
| 21 | 21 |          $this->config = $this->container->get('config'); | 
| 22 | 22 |          $this->redis = $this->container->get('redis'); | 
| @@ -120,6 +120,10 @@ discard block | ||
| 120 | 120 | } | 
| 121 | 121 | } | 
| 122 | 122 | |
| 123 | + /** | |
| 124 | + * @param string $metric | |
| 125 | + * @param integer $server | |
| 126 | + */ | |
| 123 | 127 | public function markAsBeingUpdated($metric, $server) | 
| 124 | 128 |      { | 
| 125 | 129 |          $key = "ps2alerts:api:leaderboards:status:{$metric}:{$server}"; | 
| @@ -139,6 +143,10 @@ discard block | ||
| 139 | 143 | $this->redis->set($key, json_encode($data)); | 
| 140 | 144 | } | 
| 141 | 145 | |
| 146 | + /** | |
| 147 | + * @param string $metric | |
| 148 | + * @param integer $server | |
| 149 | + */ | |
| 142 | 150 | public function markAsComplete($metric, $server) | 
| 143 | 151 |      { | 
| 144 | 152 |          $key = "ps2alerts:api:leaderboards:status:{$metric}:{$server}"; | 
| @@ -13,7 +13,7 @@ discard block | ||
| 13 | 13 |      { | 
| 14 | 14 | parent::configure(); // See BaseCommand.php | 
| 15 | 15 |          $this->setName('Leaderboards:Outfits') | 
| 16 | -             ->setDescription('Processes all outfit leaderboards'); | |
| 16 | +                ->setDescription('Processes all outfit leaderboards'); | |
| 17 | 17 | |
| 18 | 18 |          $this->redis = $this->container->get('redis'); | 
| 19 | 19 | } | 
| @@ -71,7 +71,7 @@ discard block | ||
| 71 | 71 | $query->cols(['*']); | 
| 72 | 72 |                      $query->from('ws_players_total'); | 
| 73 | 73 |                      if ($server !== 0) { | 
| 74 | -                         $query->where('playerServer', $server); | |
| 74 | +                            $query->where('playerServer', $server); | |
| 75 | 75 | } | 
| 76 | 76 | $query->orderBy([$metric . ' DESC']); | 
| 77 | 77 | $query->limit($limit); | 
| @@ -184,6 +184,9 @@ discard block | ||
| 184 | 184 | } | 
| 185 | 185 | } | 
| 186 | 186 | |
| 187 | + /** | |
| 188 | + * @param string $metric | |
| 189 | + */ | |
| 187 | 190 | public function markAsBeingUpdated($metric, $server) | 
| 188 | 191 |      { | 
| 189 | 192 |          $key = "ps2alerts:api:leaderboards:status:{$server}"; | 
| @@ -205,6 +208,9 @@ discard block | ||
| 205 | 208 | $this->redis->set($key, json_encode($data)); | 
| 206 | 209 | } | 
| 207 | 210 | |
| 211 | + /** | |
| 212 | + * @param string $metric | |
| 213 | + */ | |
| 208 | 214 | public function markMetricAsComplete($metric, $server) | 
| 209 | 215 |      { | 
| 210 | 216 |          $key = "ps2alerts:api:leaderboards:status:{$server}"; | 
| @@ -13,11 +13,11 @@ discard block | ||
| 13 | 13 |      { | 
| 14 | 14 | parent::configure(); // See BaseCommand.php | 
| 15 | 15 |          $this->setName('Leaderboards:Players') | 
| 16 | -             ->setDescription('Processes player leaderboards') | |
| 17 | - ->addArgument( | |
| 16 | +                ->setDescription('Processes player leaderboards') | |
| 17 | + ->addArgument( | |
| 18 | 18 | 'server', | 
| 19 | 19 | InputArgument::REQUIRED | 
| 20 | - ); | |
| 20 | + ); | |
| 21 | 21 | |
| 22 | 22 |          $this->redis = $this->container->get('redis'); | 
| 23 | 23 | } | 
| @@ -86,7 +86,7 @@ discard block | ||
| 86 | 86 | $query->cols(['*']); | 
| 87 | 87 |                      $query->from('ws_players_total'); | 
| 88 | 88 |                      if ($server != 0) { | 
| 89 | -                         $query->where("playerServer = ?", $server); | |
| 89 | +                            $query->where("playerServer = ?", $server); | |
| 90 | 90 | } | 
| 91 | 91 | $query->orderBy([$metric . ' DESC']); | 
| 92 | 92 | $query->limit($limit); | 
| @@ -20,7 +20,7 @@ discard block | ||
| 20 | 20 | /** | 
| 21 | 21 | * Set the http message request | 
| 22 | 22 | * | 
| 23 | - * @param \Zend\Diactoros\ServerRequestFactory $obj | |
| 23 | + * @param ServerRequest $obj | |
| 24 | 24 | */ | 
| 25 | 25 | public function setRequest(ServerRequest $obj) | 
| 26 | 26 |      { | 
| @@ -30,7 +30,6 @@ discard block | ||
| 30 | 30 | /** | 
| 31 | 31 | * Getthe http message request | 
| 32 | 32 | * | 
| 33 | - * @param \Zend\Diactoros\ServerRequestFactory $obj | |
| 34 | 33 | */ | 
| 35 | 34 | public function getRequest() | 
| 36 | 35 |      { | 
| @@ -98,8 +98,6 @@ discard block | ||
| 98 | 98 | * @param string $kind The kind of data we wish to return | 
| 99 | 99 | * @param array $data The data itself | 
| 100 | 100 | * @param \League\Fractal\TransformerAbstract $callback The transformer class to call | 
| 101 | - * @param \Psr\Http\Message\ServerRequestInterface $request The request itself | |
| 102 | - * @param \Psr\Http\Message\ResponseInterface $response The response object to eventually call | |
| 103 | 101 | * | 
| 104 | 102 | * @return \Psr\Http\Message\ResponseInterface | 
| 105 | 103 | */ | 
| @@ -122,9 +120,8 @@ discard block | ||
| 122 | 120 | * | 
| 123 | 121 | * @param array $item The item to transform | 
| 124 | 122 | * @param \League\Fractal\TransformerAbstract $transformer The Transformer to pass through to Fractal | 
| 125 | - * @param \Psr\Http\Message\ResponseInterface $response The client's response | |
| 126 | 123 | * | 
| 127 | - * @return array | |
| 124 | + * @return ResponseInterface | |
| 128 | 125 | */ | 
| 129 | 126 | protected function respondWithItem($item, $transformer) | 
| 130 | 127 |      { | 
| @@ -152,9 +149,8 @@ discard block | ||
| 152 | 149 | * | 
| 153 | 150 | * @param array $collection The collection to transform | 
| 154 | 151 | * @param \League\Fractal\TransformerAbstract $transformer The Transformer to pass through to Fractal | 
| 155 | - * @param \Psr\Http\Message\ResponseInterface $response The client's response | |
| 156 | 152 | * | 
| 157 | - * @return array | |
| 153 | + * @return ResponseInterface | |
| 158 | 154 | */ | 
| 159 | 155 | protected function respondWithCollection($collection, $transformer) | 
| 160 | 156 |      { | 
| @@ -180,7 +176,6 @@ discard block | ||
| 180 | 176 | /** | 
| 181 | 177 | * The final step where the formatted array is now sent back as a response in JSON form | 
| 182 | 178 | * | 
| 183 | - * @param \Psr\Http\Message\ResponseInterface $response | |
| 184 | 179 | * @param array $array | 
| 185 | 180 | * | 
| 186 | 181 | * @return \Psr\Http\Message\ResponseInterface | 
| @@ -210,11 +205,10 @@ discard block | ||
| 210 | 205 | /** | 
| 211 | 206 | * Responds gracefully with an error. | 
| 212 | 207 | * | 
| 213 | - * @param \Psr\Http\Message\ResponseInterface $response | |
| 214 | 208 | * @param string $message Response message to put in the error | 
| 215 | 209 | * @param int $errorCode Error code to set | 
| 216 | 210 | * | 
| 217 | - * @return array | |
| 211 | + * @return ResponseInterface | |
| 218 | 212 | */ | 
| 219 | 213 | protected function respondWithError($message, $errorCode) | 
| 220 | 214 |      { | 
| @@ -238,10 +232,9 @@ discard block | ||
| 238 | 232 | /** | 
| 239 | 233 | * Generates a response with a 404 HTTP error and a given message. | 
| 240 | 234 | * | 
| 241 | - * @param \Psr\Http\Message\ResponseInterface $response | |
| 242 | 235 | * @param string $message | 
| 243 | 236 | * | 
| 244 | - * @return void | |
| 237 | + * @return ResponseInterface | |
| 245 | 238 | */ | 
| 246 | 239 | public function errorEmpty($message = 'No data / Empty') | 
| 247 | 240 |      { | 
| @@ -252,10 +245,9 @@ discard block | ||
| 252 | 245 | /** | 
| 253 | 246 | * Generates a Response with a 403 HTTP header and a given message. | 
| 254 | 247 | * | 
| 255 | - * @param \Psr\Http\Message\ResponseInterface $response | |
| 256 | 248 | * @param string $message | 
| 257 | 249 | * | 
| 258 | - * @return void | |
| 250 | + * @return ResponseInterface | |
| 259 | 251 | */ | 
| 260 | 252 | public function errorForbidden($message = 'Forbidden') | 
| 261 | 253 |      { | 
| @@ -266,10 +258,9 @@ discard block | ||
| 266 | 258 | /** | 
| 267 | 259 | * Generates a Response with a 500 HTTP header and a given message. | 
| 268 | 260 | * | 
| 269 | - * @param \Psr\Http\Message\ResponseInterface $response | |
| 270 | 261 | * @param string $message | 
| 271 | 262 | * | 
| 272 | - * @return void | |
| 263 | + * @return ResponseInterface | |
| 273 | 264 | */ | 
| 274 | 265 | public function errorInternalError($message = 'Internal Error') | 
| 275 | 266 |      { | 
| @@ -280,10 +271,9 @@ discard block | ||
| 280 | 271 | /** | 
| 281 | 272 | * Generates a Response with a 404 HTTP header and a given message. | 
| 282 | 273 | * | 
| 283 | - * @param \Psr\Http\Message\ResponseInterface $response | |
| 284 | 274 | * @param string $message | 
| 285 | 275 | * | 
| 286 | - * @return void | |
| 276 | + * @return ResponseInterface | |
| 287 | 277 | */ | 
| 288 | 278 | public function errorNotFound($message = 'Resource Not Found') | 
| 289 | 279 |      { | 
| @@ -294,10 +284,9 @@ discard block | ||
| 294 | 284 | /** | 
| 295 | 285 | * Generates a Response with a 401 HTTP header and a given message. | 
| 296 | 286 | * | 
| 297 | - * @param \Psr\Http\Message\ResponseInterface $response | |
| 298 | 287 | * @param string $message | 
| 299 | 288 | * | 
| 300 | - * @return void | |
| 289 | + * @return ResponseInterface | |
| 301 | 290 | */ | 
| 302 | 291 | public function errorUnauthorized($message = 'Unauthorized') | 
| 303 | 292 |      { | 
| @@ -308,7 +297,6 @@ discard block | ||
| 308 | 297 | /** | 
| 309 | 298 | * Generates a Response with a 400 HTTP header and a given message. | 
| 310 | 299 | * | 
| 311 | - * @param \Psr\Http\Message\ResponseInterface $response | |
| 312 | 300 | * @param string $message | 
| 313 | 301 | * | 
| 314 | 302 | * @return \Psr\Http\Message\ResponseInterface | 
| @@ -322,7 +310,6 @@ discard block | ||
| 322 | 310 | /** | 
| 323 | 311 | * Reads any requested includes and adds them to the item / collection | 
| 324 | 312 | * | 
| 325 | - * @param Psr\Http\Message\ServerRequestInterface $request | |
| 326 | 313 | * | 
| 327 | 314 | * @return void | 
| 328 | 315 | */ | 
| @@ -24,7 +24,7 @@ discard block | ||
| 24 | 24 | * Retrieves combat totals on a global and per-server basis | 
| 25 | 25 | * @param ServerRequestInterface $request | 
| 26 | 26 | * @param ResponseInterface $response | 
| 27 | - * @return array | |
| 27 | + * @return ResponseInterface | |
| 28 | 28 | */ | 
| 29 | 29 | public function getCombatTotals(ServerRequestInterface $request, ResponseInterface $response) | 
| 30 | 30 |      { | 
| @@ -250,6 +250,9 @@ discard block | ||
| 250 | 250 | return $this->respondWithArray($results); | 
| 251 | 251 | } | 
| 252 | 252 | |
| 253 | + /** | |
| 254 | + * @param integer $classID | |
| 255 | + */ | |
| 253 | 256 | private function findClassGrouping($classID) | 
| 254 | 257 |      { | 
| 255 | 258 | $classGroups = $this->getConfig()['classesGroups']; | 
| @@ -265,6 +268,9 @@ discard block | ||
| 265 | 268 | return false; | 
| 266 | 269 | } | 
| 267 | 270 | |
| 271 | + /** | |
| 272 | + * @param integer $classID | |
| 273 | + */ | |
| 268 | 274 | private function findClassFaction($classID) | 
| 269 | 275 |      { | 
| 270 | 276 | $classesFactions = $this->getConfig()['classesFactions']; | 
| @@ -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 |