Completed
Push — master ( e67dbb...fb18fc )
by Matthew
09:33
created
src/Controller/Metrics/ClassMetricsEndpoint.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
     /**
14 14
      * Returns a single entry
15 15
      *
16
-     * @param  Symfony\Component\HttpFoundation\Request $request
16
+     * @param  Request $request
17 17
      * @param  array   $args
18 18
      *
19 19
      * @return \League\Route\Http\JsonResponse
Please login to merge, or discard this patch.
src/Controller/Alerts/AlertEndpointController.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use League\Route\Http\JsonResponse as Response;
6 6
 use Ps2alerts\Api\Controller\EndpointBaseController;
7
-use Ps2alerts\Api\QueryObjects\QueryObject;
8 7
 use Ps2alerts\Api\Loader\ResultLoader;
9 8
 use Symfony\Component\HttpFoundation\Request;
10 9
 
Please login to merge, or discard this patch.
src/Controller/Statistics/OutfitTotalsStatisticsEndpoint.php 1 patch
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     /**
13 13
      * Construct
14 14
      *
15
-     * @param \Ps2alerts\Api\Loader\Metrics\OutfitTotalsStatisticsLoader $loader
15
+     * @param OutfitTotalsStatisticsLoader $loader
16 16
      */
17 17
     public function __construct(OutfitTotalsStatisticsLoader $loader)
18 18
     {
@@ -23,7 +23,6 @@  discard block
 block discarded – undo
23 23
      * Returns top X entries
24 24
      *
25 25
      * @param  \Symfony\Component\HttpFoundation\Request $request
26
-     * @param  array                                     $args
27 26
      *
28 27
      * @return \League\Route\Http\JsonResponse
29 28
      */
Please login to merge, or discard this patch.
src/Controller/Statistics/PlayerStatisticsEndpoint.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     /**
13 13
      * Construct
14 14
      *
15
-     * @param \Ps2alerts\Api\Loader\Metrics\PlayerStatisticsLoader $loader
15
+     * @param PlayerStatisticsLoader $loader
16 16
      */
17 17
     public function __construct(PlayerStatisticsLoader $loader)
18 18
     {
Please login to merge, or discard this patch.
src/Loader/Statistics/OutfitTotalsStatisticsLoader.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     /**
17 17
      * Construct
18 18
      *
19
-     * @param \Ps2alerts\Api\Repository\Metrics\OutfitTotalsRepository $repository
19
+     * @param OutfitTotalsRepository $repository
20 20
      */
21 21
     public function __construct(OutfitTotalsRepository $repository)
22 22
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use League\Route\Http\JsonResponse as Response;
6 6
 use Ps2alerts\Api\Controller\EndpointBaseController;
7
-use Ps2alerts\Api\QueryObjects\QueryObject;
8 7
 use Ps2alerts\Api\Loader\ResultLoader;
9 8
 use Symfony\Component\HttpFoundation\Request;
10 9
 
Please login to merge, or discard this patch.
src/Loader/Statistics/PlayerStatisticsLoader.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -91,6 +91,9 @@
 block discarded – undo
91 91
         );
92 92
     }
93 93
 
94
+    /**
95
+     * @param string $field
96
+     */
94 97
     public function validatePostVars($field, $value)
95 98
     {
96 99
         if ($field === 'metric' && ! empty($value)) {
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
         $queryObject = new QueryObject;
33 33
 
34 34
         // Build based on metric alone (order by playerKills for example)
35
-        if (! empty($post['metric'] && empty($post['value']))
35
+        if (!empty($post['metric'] && empty($post['value']))
36 36
             && $this->validatePostVars('metric', $post['metric']) === true
37 37
         ) {
38
-            $direction = (! empty($post['direction']) ? $post['direction'] : 'desc');
38
+            $direction = (!empty($post['direction']) ? $post['direction'] : 'desc');
39 39
 
40 40
             $queryObject->setOrderBy($post['metric']);
41 41
             $queryObject->setOrderByDirection($direction);
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
         }
45 45
 
46 46
         // Build based on metric and a value (such as order by playerKills by server)
47
-        if (! empty($post['value'])
48
-            && ! empty($post['metric'])
47
+        if (!empty($post['value'])
48
+            && !empty($post['metric'])
49 49
             && $this->validatePostVars('metric', $post['metric']) === true
50 50
         ) {
51
-            $op = (! empty($post['operator']) ? $post['operator'] : '=');
51
+            $op = (!empty($post['operator']) ? $post['operator'] : '=');
52 52
 
53 53
             $queryObject->addWhere([
54 54
                 'col' => $post['metric'],
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
                 'value' => $post['value']
57 57
             ]);
58 58
 
59
-            $direction = (! empty($post['direction']) ? $post['direction'] : 'desc');
59
+            $direction = (!empty($post['direction']) ? $post['direction'] : 'desc');
60 60
 
61 61
             $queryObject->setOrderBy($post['metric']);
62 62
             $queryObject->setOrderByDirection($direction);
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             $redisKey .= ":{$post['metric']}{$op}{$post['value']}-{$direction}";
65 65
         }
66 66
 
67
-        if (! empty($post['limit'])) {
67
+        if (!empty($post['limit'])) {
68 68
             $post['limit'] = intval($post['limit']);
69 69
 
70 70
             // Hard encode a 50 limit
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
     public function validatePostVars($field, $value)
95 95
     {
96
-        if ($field === 'metric' && ! empty($value)) {
96
+        if ($field === 'metric' && !empty($value)) {
97 97
             switch ($value) {
98 98
                 case 'playerKills':
99 99
                 case 'playerDeaths':
Please login to merge, or discard this patch.
src/QueryObjects/QueryObject.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      * in the array and added to.
50 50
      * e.g. $queryObject->addSelect('COUNT(ResultID) AS COUNT');
51 51
      *
52
-     * @param string $string
52
+     * @param string $array
53 53
      */
54 54
     public function addSelect($array)
55 55
     {
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     /**
172 172
      * Allows setting of workaround flags
173 173
      *
174
-     * @param array|string $flags
174
+     * @param string $flags
175 175
      */
176 176
     public function setFlags($flags)
177 177
     {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
      */
119 119
     public function setOrderBy($string)
120 120
     {
121
-        if (! empty($string)) {
121
+        if (!empty($string)) {
122 122
             $this->orderBy = $string;
123 123
         }
124 124
     }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
      */
141 141
     public function setOrderByDirection($string)
142 142
     {
143
-        if (! empty($string)) {
143
+        if (!empty($string)) {
144 144
             $this->orderByDirection = $string;
145 145
         }
146 146
     }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
      */
163 163
     public function setDimension($string)
164 164
     {
165
-        if (! empty($string)) {
165
+        if (!empty($string)) {
166 166
             $this->dimension = $string;
167 167
         }
168 168
     }
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      */
185 185
     public function setLimit($limit)
186 186
     {
187
-        if (! empty($limit)) {
187
+        if (!empty($limit)) {
188 188
             $this->limit = $limit;
189 189
         }
190 190
     }
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
      */
207 207
     public function setFlags($flags)
208 208
     {
209
-        if (! empty($flags)) {
209
+        if (!empty($flags)) {
210 210
             $this->flags = $flags;
211 211
         }
212 212
     }
Please login to merge, or discard this patch.
src/Loader/AlertLoader.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
             'value' => date('U', strtotime('-48 hours'))
42 42
         ]);
43 43
 
44
-        if (! empty($args['serverID'])) {
44
+        if (!empty($args['serverID'])) {
45 45
             $redisKey .= ":{$args['serverID']}";
46 46
             $queryObject->addWhere([
47 47
                 'col'   => 'ResultServer',
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             ]);
50 50
         }
51 51
 
52
-        if (! empty($args['limit'])) {
52
+        if (!empty($args['limit'])) {
53 53
             if ($args['limit'] > 50) {
54 54
                 $args['limit'] = 50;
55 55
             }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             'value' => 1
82 82
         ]);
83 83
 
84
-        if (! empty($args['serverID'])) {
84
+        if (!empty($args['serverID'])) {
85 85
             $queryObject->addWhere([
86 86
                 'col'   => 'ResultServer',
87 87
                 'value' => $args['serverID']
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.