Completed
Pull Request — master (#22)
by Matthew
03:34 queued 01:56
created
src/ServiceProvider/DatabaseServiceProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
      */
24 24
     public function register()
25 25
     {
26
-        $this->getContainer()->share('Database', function () {
26
+        $this->getContainer()->share('Database', function() {
27 27
             $config = $this->getContainer()->get('config')['database'];
28 28
 
29 29
             $pdo = new ExtendedPdo(
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
             return $pdo;
36 36
         });
37 37
 
38
-        $this->getContainer()->share('Database\Data', function () {
38
+        $this->getContainer()->share('Database\Data', function() {
39 39
             $config = $this->getContainer()->get('config')['database_data'];
40 40
 
41 41
             $pdo = new ExtendedPdo(
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
             return $pdo;
48 48
         });
49 49
 
50
-        $this->getContainer()->share('Database\Archive', function () {
50
+        $this->getContainer()->share('Database\Archive', function() {
51 51
             $config = $this->getContainer()->get('config')['database_archive'];
52 52
 
53 53
             $pdo = new ExtendedPdo(
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
             return $pdo;
60 60
         });
61 61
 
62
-        $this->getContainer()->add('Aura\SqlQuery\QueryFactory', function () {
62
+        $this->getContainer()->add('Aura\SqlQuery\QueryFactory', function() {
63 63
             return new QueryFactory('mysql');
64 64
         });
65 65
     }
Please login to merge, or discard this patch.
src/ServiceProvider/RedisServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
      */
24 24
     public function register()
25 25
     {
26
-        $this->getContainer()->add('redis', function () {
26
+        $this->getContainer()->add('redis', function() {
27 27
             $redisConfig = $this->getContainer()->get('config')['redis'];
28 28
 
29 29
             $args = [
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
                 'scheme'   => 'tcp',
34 34
             ];
35 35
 
36
-            if (! empty($redisConfig['pass'])) {
36
+            if (!empty($redisConfig['pass'])) {
37 37
                 $args['password'] = $redisConfig['pass'];
38 38
             }
39 39
 
Please login to merge, or discard this patch.
src/ServiceProvider/FractalServiceProvider.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()->share('League\Fractal\Manager', function () {
22
+        $this->getContainer()->share('League\Fractal\Manager', function() {
23 23
             return new Manager;
24 24
         });
25 25
     }
Please login to merge, or discard this patch.
src/ServiceProvider/LogServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public function register()
23 23
     {
24
-        $this->getContainer()->share('Monolog\Logger', function () {
24
+        $this->getContainer()->share('Monolog\Logger', function() {
25 25
             $log = new Logger('app');
26 26
 
27 27
             $config = $this->getContainer()->get('config');
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             }
40 40
 
41 41
             $log->pushHandler(
42
-                new StreamHandler(__DIR__ . '/../../logs/app.log', Logger::DEBUG)
42
+                new StreamHandler(__DIR__.'/../../logs/app.log', Logger::DEBUG)
43 43
             );
44 44
 
45 45
             return $log;
Please login to merge, or discard this patch.
src/ServiceProvider/HttpClientServiceProvider.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('GuzzleHttp\Client', function () {
22
+        $this->getContainer()->add('GuzzleHttp\Client', function() {
23 23
             return new Client([
24 24
                 'timeout' => 10.0
25 25
             ]);
Please login to merge, or discard this patch.
src/Command/DeleteMissingAlertsCommand.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
         $missing = 0;
41 41
         $max = $result->ResultID;
42 42
 
43
-        while($count < $max) {
43
+        while ($count < $max) {
44 44
             $count++;
45 45
 
46 46
             $per = round(($count / $max) * 100, 2);
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 Ps2alerts\Api\Command\BaseCommand;
6 6
 use Ps2alerts\Api\Repository\AlertRepository;
7
-use Symfony\Component\Console\Input\InputArgument;
8 7
 use Symfony\Component\Console\Input\InputInterface;
9 8
 use Symfony\Component\Console\Output\OutputInterface;
10 9
 
Please login to merge, or discard this patch.
src/Command/CommandsCommon.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 function convert($size) {
4
-    $unit=array('B','KB','MB','GB','TB','PB');
5
-    return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];
4
+    $unit = array('B', 'KB', 'MB', 'GB', 'TB', 'PB');
5
+    return @round($size / pow(1024, ($i = floor(log($size, 1024)))), 2).' '.$unit[$i];
6 6
 }
Please login to merge, or discard this patch.
src/Command/DeleteAlertCommand.php 3 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
     ) {
195 195
         // Check each cols to make sure we handle SUM(BLAH) AS BLAH issues
196 196
 
197
-        foreach($cols as $key => $col) {
197
+        foreach ($cols as $key => $col) {
198 198
             if (strpos($col, 'AS ') !== false) {
199 199
                 $pos = strrpos($col, 'AS ') + 3; // Plus 3 for "AS "
200 200
                 $len = strlen($col);
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
         $query->from($table);
211 211
         $query->where('resultID = ?', $id);
212 212
 
213
-        if (! empty($groupBy)) {
213
+        if (!empty($groupBy)) {
214 214
             $query->groupBy($groupBy);
215 215
         }
216 216
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
             $update->table($totalsTable);
227 227
             $update->where("{$filter} = ?", $row->$filter);
228 228
 
229
-            foreach($fields as $field) {
229
+            foreach ($fields as $field) {
230 230
                 $update->set($field, "{$field} - {$row->$field}");
231 231
             }
232 232
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 
240 240
     protected function deleteAllFromTables(array $tables, $id, OutputInterface $output)
241 241
     {
242
-        foreach($tables as $table) {
242
+        foreach ($tables as $table) {
243 243
             $delete = $this->auraFactory->newDelete();
244 244
             $delete->from($table);
245 245
             $delete->where('resultID = ?', $id);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $alert = $this->alertRepo->readSingleById($id, 'primary', true);
55 55
 
56 56
         if (empty($force) && empty($id)) {
57
-            $output->writeln("ALERT {$id} DOES NOT EXIST!");
57
+            $output->writeln("alert {$id} DOES NOT EXIST!");
58 58
             return false;
59 59
         }
60 60
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         $this->deleteAlert($id);
100 100
 
101 101
         if ($this->verbose === 1) {
102
-            $output->writeln("Alert {$id} successfully deleted!");
102
+            $output->writeln("alert {$id} successfully deleted!");
103 103
         }
104 104
 
105 105
         return true;
Please login to merge, or discard this patch.
Doc Comments   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     /**
116 116
      * Processes players for alert
117 117
      * @param  string $id Alert ID
118
-     * @return void
118
+     * @return integer
119 119
      */
120 120
     protected function processPlayers($id)
121 121
     {
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     /**
150 150
      * Processes outfits for alert
151 151
      * @param  string $id Alert ID
152
-     * @return void
152
+     * @return integer
153 153
      */
154 154
     protected function processOutfits($id)
155 155
     {
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
     /**
182 182
      * Processes XPs for alert
183 183
      * @param  string $id Alert ID
184
-     * @return void
184
+     * @return integer
185 185
      */
186 186
     protected function processXP($id)
187 187
     {
@@ -208,11 +208,11 @@  discard block
 block discarded – undo
208 208
     /**
209 209
      * Executes the process based on inputs
210 210
      * @param  string $id          Alert ID
211
-     * @param  array  $cols        Columns to look for
211
+     * @param  string[]  $cols        Columns to look for
212 212
      * @param  string $table       Table to look for
213 213
      * @param  string $totalsTable Table total to update if applicable
214 214
      * @param  string $filter      Column to filter on
215
-     * @param  array  $fields      Fields to summarize
215
+     * @param  string[]  $fields      Fields to summarize
216 216
      * @param  array  $groupBy     Fields to group by
217 217
      * @return int
218 218
      */
@@ -270,6 +270,9 @@  discard block
 block discarded – undo
270 270
         return $count;
271 271
     }
272 272
 
273
+    /**
274
+     * @param string $id
275
+     */
273 276
     protected function deleteAllFromTables(array $tables, $id, OutputInterface $output)
274 277
     {
275 278
         foreach($tables as $table) {
@@ -288,6 +291,9 @@  discard block
 block discarded – undo
288 291
         }
289 292
     }
290 293
 
294
+    /**
295
+     * @param string $id
296
+     */
291 297
     protected function deleteAlert($id)
292 298
     {
293 299
         $delete = $this->auraFactory->newDelete();
Please login to merge, or discard this patch.
src/Controller/Endpoint/Admin/AdminEndpointController.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     /**
12 12
      * Construct
13 13
      *
14
-    */
14
+     */
15 15
     public function __construct()
16 16
     {
17 17
 
Please login to merge, or discard this patch.