@@ -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 | } |
@@ -14,7 +14,6 @@ |
||
| 14 | 14 | use Ps2alerts\Api\Repository\Metrics\VehicleTotalRepository; |
| 15 | 15 | use Ps2alerts\Api\Repository\Metrics\WeaponTotalRepository; |
| 16 | 16 | use Ps2alerts\Api\Repository\Metrics\XpRepository; |
| 17 | - |
|
| 18 | 17 | use Ps2alerts\Api\Transformer\Metrics\ClassTransformer; |
| 19 | 18 | use Ps2alerts\Api\Transformer\Metrics\CombatHistoryTransformer; |
| 20 | 19 | use Ps2alerts\Api\Transformer\Metrics\CombatTransformer; |
@@ -57,7 +57,6 @@ |
||
| 57 | 57 | /** |
| 58 | 58 | * The tranform method required by Fractal to parse the data and return proper typing and fields. |
| 59 | 59 | * |
| 60 | - * @param array $data Data to transform |
|
| 61 | 60 | * |
| 62 | 61 | * @return array |
| 63 | 62 | */ |
@@ -219,6 +219,9 @@ |
||
| 219 | 219 | return $players; |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | + /** |
|
| 223 | + * @param integer $offset |
|
| 224 | + */ |
|
| 222 | 225 | public function getOutfitMembers($data, $offset) |
| 223 | 226 | { |
| 224 | 227 | $client = $this->getHttpClientDriver(); |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $key = "ps2alerts:api:profiles:outfit:players:{$data['outfitID']}"; |
| 192 | 192 | |
| 193 | 193 | // If we have this cached already |
| 194 | - if (! empty($redis->exists($key))) { |
|
| 194 | + if (!empty($redis->exists($key))) { |
|
| 195 | 195 | return json_decode($redis->get($key), true); |
| 196 | 196 | } |
| 197 | 197 | |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | $key = "ps2alerts:api:profiles:outfit:census:members:{$data['outfitID']}:{$offset}"; |
| 228 | 228 | |
| 229 | 229 | // If we have this cached already |
| 230 | - if (! empty($redis->exists($key))) { |
|
| 230 | + if (!empty($redis->exists($key))) { |
|
| 231 | 231 | return json_decode($redis->get($key)); |
| 232 | 232 | } |
| 233 | 233 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * |
| 73 | 73 | * @param array $data |
| 74 | 74 | * |
| 75 | - * @return \League\Fractal\Resource\Collection |
|
| 75 | + * @return \League\Fractal\Resource\Item |
|
| 76 | 76 | */ |
| 77 | 77 | public function includeCensus($data) |
| 78 | 78 | { |
@@ -144,9 +144,8 @@ discard block |
||
| 144 | 144 | /** |
| 145 | 145 | * Gets Metrics for a player |
| 146 | 146 | * |
| 147 | - * @param array $player |
|
| 148 | 147 | * |
| 149 | - * @return array |
|
| 148 | + * @return \League\Fractal\Resource\Item |
|
| 150 | 149 | */ |
| 151 | 150 | public function includeMetrics($data) |
| 152 | 151 | { |
@@ -179,7 +178,7 @@ discard block |
||
| 179 | 178 | * |
| 180 | 179 | * @param array $data |
| 181 | 180 | * |
| 182 | - * @return \League\Fractal\Resource\Collection |
|
| 181 | + * @return \League\Fractal\Resource\Item |
|
| 183 | 182 | */ |
| 184 | 183 | public function includeOutfit($data) |
| 185 | 184 | { |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $key = $this->returnKeyType($keyType); |
| 185 | 185 | |
| 186 | 186 | $query->cols(['*']) |
| 187 | - ->where("{$key} = ?", $id); |
|
| 187 | + ->where("{$key} = ?", $id); |
|
| 188 | 188 | |
| 189 | 189 | return $this->fireStatementAndReturn($query, true, $object, $archive); |
| 190 | 190 | } |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | $key = $this->returnKeyType($keyType); |
| 222 | 222 | |
| 223 | 223 | $query->cols(['*']) |
| 224 | - ->where("{$key} = ?", $id); |
|
| 224 | + ->where("{$key} = ?", $id); |
|
| 225 | 225 | |
| 226 | 226 | return $this->fireStatementAndReturn($query, false, false, $archive); |
| 227 | 227 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | $obj = [ |
| 19 | 19 | 'id' => (string) $data->outfit_id, // Bigint |
| 20 | 20 | 'name' => (string) $data->name, |
| 21 | - 'tag' => (! empty($data->alias)) ? (string) $data->alias : null, |
|
| 21 | + 'tag' => (!empty($data->alias)) ? (string) $data->alias : null, |
|
| 22 | 22 | 'faction' => (int) $data->leader->faction_id, |
| 23 | 23 | 'count' => (int) $data->member_count, |
| 24 | 24 | 'leader' => (string) $data->leader_character_id, |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | public function transform($data) |
| 17 | 17 | { |
| 18 | - if (! isset($data['playerOutfit'])) { |
|
| 18 | + if (!isset($data['playerOutfit'])) { |
|
| 19 | 19 | $outfit = null; |
| 20 | 20 | } else { |
| 21 | 21 | $outfit = $data['playerOutfit']; |
@@ -148,7 +148,7 @@ |
||
| 148 | 148 | /** |
| 149 | 149 | * Admin |
| 150 | 150 | */ |
| 151 | -$route->group('/admin', function ($route) { |
|
| 151 | +$route->group('/admin', function($route) { |
|
| 152 | 152 | $route->post( |
| 153 | 153 | '/v2/admin/createAlert', |
| 154 | 154 | 'Ps2alerts\Api\Controller\Endpoint\Admin\AdminEndpointController::createAlert' |