Completed
Push — master ( e849b9...fa53d4 )
by Matthew
02:01
created
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 1 patch
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.
src/Command/LeaderboardOutfitsCommand.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         $this->playerLeaderboards($output);
28 28
 
29 29
         $end = microtime(true);
30
-        $output->writeln("Processing took " . gmdate("H:i:s", ($end - $start)));
30
+        $output->writeln("Processing took ".gmdate("H:i:s", ($end - $start)));
31 31
     }
32 32
 
33 33
     public function playerLeaderboards(OutputInterface $output)
@@ -39,16 +39,16 @@  discard block
 block discarded – undo
39 39
             'playerSuicides',
40 40
             'headshots'
41 41
         ];
42
-        $servers = [0,1,10,13,17,25,1000,2000];
42
+        $servers = [0, 1, 10, 13, 17, 25, 1000, 2000];
43 43
 
44
-        foreach($servers as $server) {
45
-            foreach($metrics as $metric) {
44
+        foreach ($servers as $server) {
45
+            foreach ($metrics as $metric) {
46 46
                 $this->markAsBeingUpdated($metric, $server);
47 47
             }
48 48
         }
49 49
 
50
-        foreach($servers as $server) {
51
-            foreach($metrics as $metric) {
50
+        foreach ($servers as $server) {
51
+            foreach ($metrics as $metric) {
52 52
                 $count = 0;
53 53
                 $limit = 10000;
54 54
                 $ladderLimit = 10000;
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
                     if ($server !== 0) {
75 75
                          $query->where('playerServer', $server);
76 76
                     }
77
-                    $query->orderBy([$metric . ' DESC']);
77
+                    $query->orderBy([$metric.' DESC']);
78 78
                     $query->limit($limit);
79 79
                     $query->offset($count);
80 80
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
                         $playerPosKey = "ps2alerts:api:leaderboards:players:pos:{$player->playerID}";
90 90
 
91 91
                         // If player record doesn't exist
92
-                        if (! $this->redis->exists($playerPosKey)) {
92
+                        if (!$this->redis->exists($playerPosKey)) {
93 93
                             $data = [
94 94
                                 'id'      => $player->playerID,
95 95
                                 'updated' => date('U', strtotime('now'))
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
                         }
100 100
 
101 101
                         // For first time running
102
-                        if (! empty($data[$server][$metric])) {
102
+                        if (!empty($data[$server][$metric])) {
103 103
                             $data[$server][$metric]['old'] = $data[$server][$metric]['new'];
104 104
                         } else {
105 105
                             $data[$server][$metric]['old'] = 0;
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         $key = "ps2alerts:api:leaderboards:status:{$metric}:{$server}";
126 126
 
127 127
         // Create the key if it doesn't exist for some reason (1st runs)
128
-        if (! $this->redis->exists($key)) {
128
+        if (!$this->redis->exists($key)) {
129 129
             $data = [
130 130
                 'beingUpdated' => 1,
131 131
                 'lastUpdated'  => 'never'
Please login to merge, or discard this patch.
src/Command/LeaderboardCheckCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
         $servers = $this->config['servers'];
35 35
         $servers[] = 0;
36 36
 
37
-        foreach($servers as $server) {
37
+        foreach ($servers as $server) {
38 38
             $output->writeln("Checking Server {$server}");
39 39
 
40 40
             $key = "ps2alerts:api:leaderboards:status:{$server}";
41 41
             $resultKey = "ps2alerts:api:leaderboards:lastResult:{$server}";
42 42
 
43
-            if (! $this->redis->exists($key)) {
43
+            if (!$this->redis->exists($key)) {
44 44
                 $output->writeln("Key doesn't exist for server {$server}! Forcing!");
45 45
                 $this->update($server, $output);
46 46
                 continue;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             $row = $statement->fetch(\PDO::FETCH_OBJ);
70 70
             $force = false;
71 71
 
72
-            if (! $this->redis->exists($resultKey)) {
72
+            if (!$this->redis->exists($resultKey)) {
73 73
                 $force = true;
74 74
             } else {
75 75
                 $lastResult = $this->redis->get($resultKey);
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/LeaderboardPlayersCommand.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         $this->playerLeaderboards($input, $output);
32 32
 
33 33
         $end = microtime(true);
34
-        $output->writeln("Processing took " . gmdate("H:i:s", ($end - $start)));
34
+        $output->writeln("Processing took ".gmdate("H:i:s", ($end - $start)));
35 35
     }
36 36
 
37 37
     public function playerLeaderboards(InputInterface $input, OutputInterface $output)
@@ -47,19 +47,19 @@  discard block
 block discarded – undo
47 47
 
48 48
         // Allows server 0, meaning all servers but not to process every server
49 49
         if ($serverArg === 'all') {
50
-            $servers = [0,1,10,13,17,25,1000,2000];
50
+            $servers = [0, 1, 10, 13, 17, 25, 1000, 2000];
51 51
         } else {
52 52
             $servers = [$serverArg];
53 53
         }
54 54
 
55
-        foreach($servers as $server) {
56
-            foreach($metrics as $metric) {
55
+        foreach ($servers as $server) {
56
+            foreach ($metrics as $metric) {
57 57
                 $this->markAsBeingUpdated($metric, $server);
58 58
             }
59 59
         }
60 60
 
61
-        foreach($servers as $server) {
62
-            foreach($metrics as $metric) {
61
+        foreach ($servers as $server) {
62
+            foreach ($metrics as $metric) {
63 63
                 $count = 0;
64 64
                 $limit = 10000;
65 65
                 $ladderLimit = 10000;
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
                     if ($server != 0) {
90 90
                          $query->where("playerServer = ?", $server);
91 91
                     }
92
-                    $query->orderBy([$metric . ' DESC']);
92
+                    $query->orderBy([$metric.' DESC']);
93 93
                     $query->limit($limit);
94 94
                     $query->offset($count);
95 95
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
                         $playerPosKey = "ps2alerts:api:leaderboards:players:pos:{$player->playerID}";
105 105
 
106 106
                         // If player record doesn't exist
107
-                        if (! $this->redis->exists($playerPosKey)) {
107
+                        if (!$this->redis->exists($playerPosKey)) {
108 108
                             $data = [
109 109
                                 'updated' => [
110 110
                                     'daily'   => date('U'),
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                             'monthly'
123 123
                         ];
124 124
 
125
-                        foreach($deadlines as $deadline) {
125
+                        foreach ($deadlines as $deadline) {
126 126
                             // Create the array if empty
127 127
                             if (empty($data[$server][$metric][$deadline])) {
128 128
                                 $data[$server][$metric][$deadline] = [];
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                             }
139 139
 
140 140
                             // Flip new to old
141
-                            if (! empty($row)) {
141
+                            if (!empty($row)) {
142 142
                                 $row['old']['pos'] = $row['new']['pos'];
143 143
                                 $row['old']['val'] = $row['new']['val'];
144 144
                             }
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
         $key = "ps2alerts:api:leaderboards:status:{$server}";
190 190
 
191 191
         // Create the key if it doesn't exist for some reason (1st runs)
192
-        if (! $this->redis->exists($key)) {
192
+        if (!$this->redis->exists($key)) {
193 193
             $data = [
194 194
                 'beingUpdated' => 1,
195 195
                 'lastUpdated'  => date('U'),
Please login to merge, or discard this patch.