Completed
Push — master ( ff6361...375f0f )
by Matthew
04:31
created
src/container.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 $container = new League\Container\Container;
4 4
 
5 5
 // Register the request object singleton to be used later in the request cyncle
6
-$container->singleton('Symfony\Component\HttpFoundation\Request', function () {
6
+$container->singleton('Symfony\Component\HttpFoundation\Request', function() {
7 7
     return Symfony\Component\HttpFoundation\Request::createFromGlobals();
8 8
 });
9 9
 
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,22 +18,22 @@
 block discarded – undo
18 18
 
19 19
 // Inflectors
20 20
 $container->inflector('Ps2alerts\Api\Contract\ConfigAwareInterface')
21
-          ->invokeMethod('setConfig', ['config']);
21
+            ->invokeMethod('setConfig', ['config']);
22 22
 $container->inflector('Ps2alerts\Api\Contract\DatabaseAwareInterface')
23
-          ->invokeMethod('setDatabaseDriver', ['Database'])
24
-          ->invokeMethod('setDatabaseDataDriver', ['Database\Data']);
23
+            ->invokeMethod('setDatabaseDriver', ['Database'])
24
+            ->invokeMethod('setDatabaseDataDriver', ['Database\Data']);
25 25
 $container->inflector('Ps2alerts\Api\Contract\LogAwareInterface')
26
-          ->invokeMethod('setLogDriver', ['Monolog\Logger']);
26
+            ->invokeMethod('setLogDriver', ['Monolog\Logger']);
27 27
 $container->inflector('Ps2alerts\Api\Contract\TemplateAwareInterface')
28
-          ->invokeMethod('setTemplateDriver', ['Twig_Environment']);
28
+            ->invokeMethod('setTemplateDriver', ['Twig_Environment']);
29 29
 $container->inflector('Ps2alerts\Api\Contract\RedisAwareInterface')
30
-          ->invokeMethod('setRedisDriver', ['redis']);
30
+            ->invokeMethod('setRedisDriver', ['redis']);
31 31
 $container->inflector('Ps2alerts\Api\Contract\UuidAwareInterface')
32
-          ->invokeMethod('setUuidDriver', ['Ramsey\Uuid\Uuid']);
32
+            ->invokeMethod('setUuidDriver', ['Ramsey\Uuid\Uuid']);
33 33
 
34 34
 
35 35
 // Container Inflector
36 36
 $container->inflector('League\Container\ContainerAwareInterface')
37
-          ->invokeMethod('setContainer', [$container]);
37
+            ->invokeMethod('setContainer', [$container]);
38 38
 
39 39
 return $container;
Please login to merge, or discard this patch.
src/ServiceProvider/ConfigServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
      */
19 19
     public function register()
20 20
     {
21
-        $this->getContainer()->singleton('config', function () {
21
+        $this->getContainer()->singleton('config', function() {
22 22
             return include __DIR__ . '/../../config/config.php';
23 23
         });
24 24
     }
Please login to merge, or discard this patch.
src/ServiceProvider/RedisServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
      */
24 24
     public function register()
25 25
     {
26
-        $this->getContainer()->singleton('redis', function () {
26
+        $this->getContainer()->singleton('redis', function() {
27 27
             $redisConfig = $this->getContainer()->get('config')['redis'];
28 28
 
29 29
             $client = new Client([
Please login to merge, or discard this patch.
src/ServiceProvider/LogServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
      */
21 21
     public function register()
22 22
     {
23
-        $this->getContainer()->singleton('Monolog\Logger', function () {
23
+        $this->getContainer()->singleton('Monolog\Logger', function() {
24 24
             $log = new Logger('app');
25 25
             $log->pushHandler(
26 26
                 new StreamHandler(__DIR__ . '/../../logs/app.log', Logger::DEBUG)
Please login to merge, or discard this patch.
src/ServiceProvider/UuidServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
      */
20 20
     public function register()
21 21
     {
22
-        $this->getContainer()->add('Ramsey\Uuid\Uuid', function () {
22
+        $this->getContainer()->add('Ramsey\Uuid\Uuid', function() {
23 23
             $uuid = Uuid::Uuid4();
24 24
             return $uuid;
25 25
         });
Please login to merge, or discard this patch.
tests/Endpoints/AlertControllerTest.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,6 @@
 block discarded – undo
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
 {
Please login to merge, or discard this patch.
src/Repository/AbstractEndpointRepository.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         $key = $this->returnKeyType($keyType);
90 90
 
91 91
         $query->cols(['*'])
92
-              ->where("`{$key}` = '{$id}'");
92
+                ->where("`{$key}` = '{$id}'");
93 93
 
94 94
         return $this->fireStatementAndReturn($query, true);
95 95
     }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         $key = $this->returnKeyType($keyType);
108 108
 
109 109
         $query->cols(['*'])
110
-              ->where("`{$key}` = '{$id}'");
110
+                ->where("`{$key}` = '{$id}'");
111 111
 
112 112
         return $this->fireStatementAndReturn($query);
113 113
     }
Please login to merge, or discard this patch.
src/Controller/Endpoint/AbstractEndpointController.php 3 patches
Doc Comments   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      * @param  \League\Fractal\TransformerAbstract        $callback The Transformer to pass through to Fractal
105 105
      * @param  \Symfony\Component\HttpFoundation\Response $response The client's response
106 106
      *
107
-     * @return array
107
+     * @return Response
108 108
      */
109 109
     protected function respondWithItem($item, $callback, Response $response)
110 110
     {
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
      * @param  \League\Fractal\TransformerAbstract        $callback   The Transformer to pass through to Fractal
122 122
      * @param  \Symfony\Component\HttpFoundation\Response $response   The client's response
123 123
      *
124
-     * @return array
124
+     * @return Response
125 125
      */
126 126
     protected function respondWithCollection($collection, $callback, Response $response)
127 127
     {
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
      * @param  string                                     $message   Response message to put in the error
157 157
      * @param  int                                        $errorCode Error code to set
158 158
      *
159
-     * @return array
159
+     * @return Response
160 160
      */
161 161
     protected function respondWithError(Response $response, $message, $errorCode)
162 162
     {
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
      * @param  \Symfony\Component\HttpFoundation\Response $response
184 184
      * @param  string                                     $message
185 185
      *
186
-     * @return void
186
+     * @return Response
187 187
      */
188 188
     public function errorEmpty(Response $response, $message = 'No data / Empty')
189 189
     {
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
      * @param  \Symfony\Component\HttpFoundation\Response $response
198 198
      * @param  string                                     $message
199 199
      *
200
-     * @return void
200
+     * @return Response
201 201
      */
202 202
     public function errorForbidden(Response $response, $message = 'Forbidden')
203 203
     {
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
      * @param  \Symfony\Component\HttpFoundation\Response $response
212 212
      * @param  string                                     $message
213 213
      *
214
-     * @return void
214
+     * @return Response
215 215
      */
216 216
     public function errorInternalError(Response $response, $message = 'Internal Error')
217 217
     {
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
      * @param  \Symfony\Component\HttpFoundation\Response $response
226 226
      * @param  string                                     $message
227 227
      *
228
-     * @return void
228
+     * @return Response
229 229
      */
230 230
     public function errorNotFound(Response $response, $message = 'Resource Not Found')
231 231
     {
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
      * @param  \Symfony\Component\HttpFoundation\Response $response
240 240
      * @param  string                                     $message
241 241
      *
242
-     * @return void
242
+     * @return Response
243 243
      */
244 244
     public function errorUnauthorized(Response $response, $message = 'Unauthorized')
245 245
     {
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
     /**
265 265
      * Reads any requested includes and adds them to the item / collection
266 266
      *
267
-     * @param  Symfony\Component\HttpFoundation\Request $request
267
+     * @param  Request $request
268 268
      *
269 269
      * @return void
270 270
      */
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -342,7 +342,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Controller/Endpoint/Alerts/AlertCountsEndpointController.php 2 patches
Doc Comments   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
     /**
21 21
      * Construct
22 22
      *
23
-     * @param Ps2alerts\Api\Repository\AlertRepository   $repository
24
-     * @param Ps2alerts\Api\Transformer\AlertTransformer $transformer
25
-     * @param League\Fractal\Manager                     $fractal
23
+     * @param AlertRepository   $repository
24
+     * @param AlertTransformer $transformer
25
+     * @param Manager                     $fractal
26 26
      */
27 27
     public function __construct(
28 28
         AlertRepository  $repository,
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
     /**
38 38
      * Returns the victories of each faction and the totals
39 39
      *
40
-     * @param  Symfony\Component\HttpFoundation\Request  $request
41
-     * @param  Symfony\Component\HttpFoundation\Response $response
40
+     * @param  Request  $request
41
+     * @param  Response $response
42 42
      *
43
-     * @return array
43
+     * @return Response
44 44
      */
45 45
     public function getVictories(Request $request, Response $response)
46 46
     {
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      * @param  \Symfony\Component\HttpFoundation\Request  $request
54 54
      * @param  \Symfony\Component\HttpFoundation\Response $response
55 55
      *
56
-     * @return array
56
+     * @return Response
57 57
      */
58 58
     public function getDominations(Request $request, Response $response)
59 59
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -208,11 +208,11 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.