@@ -1,8 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | use GuzzleHttp\Client; |
| 4 | -use GuzzleHttp\Psr7\Request; |
|
| 5 | -use GuzzleHttp\Psr7\Response; |
|
| 6 | 4 | |
| 7 | 5 | class AlertControllerTest extends \PHPUnit_Framework_TestCase |
| 8 | 6 | { |
@@ -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 | */ |
@@ -7,7 +7,6 @@ |
||
| 7 | 7 | use Symfony\Component\Console\Command\Command; |
| 8 | 8 | use Symfony\Component\Console\Input\InputArgument; |
| 9 | 9 | use Symfony\Component\Console\Input\InputInterface; |
| 10 | -use Symfony\Component\Console\Input\InputOption; |
|
| 11 | 10 | use Symfony\Component\Console\Output\OutputInterface; |
| 12 | 11 | |
| 13 | 12 | class ArchiveCommand extends BaseCommand |
@@ -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, |
@@ -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 | |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace Ps2alerts\Api\Command; |
| 4 | 4 | |
| 5 | 5 | use Ps2alerts\Api\Command\BaseCommand; |
| 6 | -use Symfony\Component\Console\Input\InputArgument; |
|
| 7 | 6 | use Symfony\Component\Console\Input\InputInterface; |
| 8 | 7 | use Symfony\Component\Console\Output\OutputInterface; |
| 9 | 8 | |
@@ -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}"; |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace Ps2alerts\Api\Command; |
| 4 | 4 | |
| 5 | 5 | use Ps2alerts\Api\Command\BaseCommand; |
| 6 | -use Symfony\Component\Console\Input\InputArgument; |
|
| 7 | 6 | use Symfony\Component\Console\Input\InputInterface; |
| 8 | 7 | use Symfony\Component\Console\Output\OutputInterface; |
| 9 | 8 | |
@@ -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}"; |
@@ -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']; |
@@ -2,11 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Ps2alerts\Api\Controller\Endpoint\Alerts; |
| 4 | 4 | |
| 5 | -use League\Fractal\Manager; |
|
| 6 | 5 | use Ps2alerts\Api\Controller\Endpoint\Alerts\AlertEndpointController; |
| 7 | 6 | use Ps2alerts\Api\Exception\InvalidArgumentException; |
| 8 | -use Ps2alerts\Api\Repository\Metrics\CombatRepository; |
|
| 9 | -use Ps2alerts\Api\Repository\Metrics\ClassRepository; |
|
| 10 | 7 | use Psr\Http\Message\ServerRequestInterface; |
| 11 | 8 | use Psr\Http\Message\ResponseInterface; |
| 12 | 9 | |