Passed
Pull Request — master (#106)
by Bob
03:51
created
src/plugins/onTick/notifications.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -172,7 +172,7 @@
 block discarded – undo
172 172
                 $this->fuelChannel = $this->toDiscordChannel;
173 173
             }
174 174
             //Set timer for next key based on number of keys
175
-            $nextKey = (1900 / (int)$this->numberOfKeys) + time();
175
+            $nextKey = (1900 / (int) $this->numberOfKeys) + time();
176 176
             $nextKeyTime = gmdate("Y-m-d H:i:s", $nextKey);
177 177
             setPermCache("notificationsLastChecked", $nextKey);
178 178
             //Set cache timer for api key
Please login to merge, or discard this patch.
src/plugins/onTick/evemails.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
         $cacheClr = $baseUnix - 13500;
147 147
 
148 148
         //Set timer for next key based on number of keys
149
-        $nextKey = (1900 / (int)$this->numberOfKeys) + time();
149
+        $nextKey = (1900 / (int) $this->numberOfKeys) + time();
150 150
         $nextKeyTime = gmdate("Y-m-d H:i:s", $nextKey);
151 151
         setPermCache("mailLastChecked", $nextKey);
152 152
 
Please login to merge, or discard this patch.
Dramiel.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -158,21 +158,21 @@  discard block
 block discarded – undo
158 158
         $discord->updatePresence($game);
159 159
 
160 160
         // Server Status Check (tick plugins will not run if eve is offline)
161
-        $discord->loop->addPeriodicTimer(60, function () use ($logger) {
161
+        $discord->loop->addPeriodicTimer(60, function() use ($logger) {
162 162
             $crestData = json_decode(downloadData('https://crest-tq.eveonline.com/'), true);
163 163
             $crestStatus = isset($crestData['serviceStatus']) ? $crestData['serviceStatus'] : 'offline';
164 164
             setPermCache('serverState', $crestStatus);
165 165
         });
166 166
 
167 167
         // Run the Tick plugins
168
-        $discord->loop->addPeriodicTimer(3, function () use ($pluginsT) {
168
+        $discord->loop->addPeriodicTimer(3, function() use ($pluginsT) {
169 169
             foreach ($pluginsT as $plugin) {
170 170
                 $plugin->tick();
171 171
             }
172 172
         });
173 173
 
174 174
         // Message queue
175
-        $discord->loop->addPeriodicTimer(7, function () use ($discord, $logger) {
175
+        $discord->loop->addPeriodicTimer(7, function() use ($discord, $logger) {
176 176
             $x = 0;
177 177
             while ($x < 3) {
178 178
                 $id = getOldestMessage();
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
         });
229 229
 
230 230
         // Mem cleanup every 30 minutes
231
-        $discord->loop->addPeriodicTimer(1800, function () use ($logger) {
231
+        $discord->loop->addPeriodicTimer(1800, function() use ($logger) {
232 232
             $logger->addInfo('Memory in use: ' . memory_get_usage() / 1024 / 1024 . 'MB');
233 233
             gc_collect_cycles(); // Collect garbage
234 234
             $logger->addInfo('Memory in use after garbage collection: ' . memory_get_usage() / 1024 / 1024 . 'MB');
Please login to merge, or discard this patch.
src/lib/dbQueries.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -101,11 +101,17 @@
 block discarded – undo
101 101
 }
102 102
 
103 103
 //CORP INFO
104
+/**
105
+ * @param string $corpName
106
+ */
104 107
 function addCorpInfo($corpID, $corpTicker, $corpName)
105 108
 {
106 109
     dbExecute('REPLACE INTO corpIDs (`corpID`, `corpTicker`, `corpName`) VALUES (:corpID,:corpTicker,:corpName)', array(':corpID' => $corpID, ':corpTicker' => $corpTicker, ':corpName' => $corpName));
107 110
 }
108 111
 
112
+/**
113
+ * @param integer $corpID
114
+ */
109 115
 function getCorpInfo($corpID)
110 116
 {
111 117
     return dbQueryRow('SELECT * FROM corpIDs WHERE `corpID` = :corpID', array(':corpID' => $corpID));
Please login to merge, or discard this patch.
src/plugins/onTick/authCheck.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -154,10 +154,10 @@  discard block
 block discarded – undo
154 154
         //Set corp/ally id arrays
155 155
         foreach ($this->authGroups as $authGroup) {
156 156
             if ($authGroup['corpID'] !== 0) {
157
-                $corpArray[] = (int)$authGroup['corpID'];
157
+                $corpArray[] = (int) $authGroup['corpID'];
158 158
             }
159 159
             if ($authGroup['allianceID'] !== 0) {
160
-                $allianceArray[] = (int)$authGroup['allianceID'];
160
+                $allianceArray[] = (int) $authGroup['allianceID'];
161 161
             }
162 162
         }
163 163
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                 $corporationID = $character['corporation_id'];
178 178
                 $corporationDetails = corpDetails($corporationID);
179 179
                 $allianceID = $corporationDetails['alliance_id'];
180
-                if (!in_array((int)$allianceID, $allianceArray) && !in_array((int)$corporationID, $corpArray)) {
180
+                if (!in_array((int) $allianceID, $allianceArray) && !in_array((int) $corporationID, $corpArray)) {
181 181
                     // Deactivate user in database
182 182
                     $sql = "UPDATE authUsers SET active='no' WHERE discordID='$discordID'";
183 183
                     $this->logger->addInfo("AuthCheck: {$eveName} account has been deactivated as they are no longer in a correct corp/alliance.");
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
         $guild = $this->discord->guilds->get('id', $this->guildID);
282 282
 
283 283
         //Get name queue status
284
-        $x = (int)getPermCache('nameQueueState');
284
+        $x = (int) getPermCache('nameQueueState');
285 285
 
286 286
         //Establish connection to mysql
287 287
         $conn = new mysqli($this->db, $this->dbUser, $this->dbPass, $this->dbName);
@@ -332,12 +332,12 @@  discard block
 block discarded – undo
332 332
                     $character = characterDetails($charID);
333 333
                     $corporationID = $character['corporation_id'];
334 334
                     $corporationDetails = corpDetails($corporationID);
335
-                    $corpTicker = (string)$corporationDetails['corpTicker'];
336
-                    $corpName = (string)$corporationDetails['corporation_name'];
335
+                    $corpTicker = (string) $corporationDetails['corpTicker'];
336
+                    $corpName = (string) $corporationDetails['corporation_name'];
337 337
                     if (null !== $corporationDetails) {
338 338
                                 if ($this->nameEnforce === 'true') {
339 339
                                     $nick = "[{$corpTicker}] {$eveName}";
340
-                                } elseif ((string)$nickName === "[{$corpTicker}]") {
340
+                                } elseif ((string) $nickName === "[{$corpTicker}]") {
341 341
                                     $nick = "[{$corpTicker}] {$userName}";
342 342
                                 } elseif (strpos($nickName, $corpTicker) === false) {
343 343
                                     $nick = "[{$corpTicker}] {$nickName}";
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
                             }
353 353
                             if ($this->nameEnforce === 'true') {
354 354
                                 $nick = "[{$corpTicker}] {$eveName}";
355
-                            } elseif ((string)$nickName === "[{$corpTicker}]") {
355
+                            } elseif ((string) $nickName === "[{$corpTicker}]") {
356 356
                                 $nick = "[{$corpTicker}] {$userName}";
357 357
                             } elseif (strpos($nickName, $corpTicker) == false) {
358 358
                                 $nick = "[{$corpTicker}] {$nickName}";
Please login to merge, or discard this patch.
src/plugins/onMessage/auth.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
                     //Check if corpID matches
144 144
                     if ($corpID === $authGroup['corpID']) {
145 145
                         foreach ($roles as $role) {
146
-                            if ((string)$role->name === (string)$authGroup['corpMemberRole']) {
146
+                            if ((string) $role->name === (string) $authGroup['corpMemberRole']) {
147 147
                                 $member->addRole($role);
148 148
                                 $corpRoleSet = 1;
149 149
                             }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
                     //Check if allianceID matches
153 153
                     if ($allianceID === $authGroup['allianceID'] && $authGroup['allianceID'] != 0) {
154 154
                         foreach ($roles as $role) {
155
-                            if ((string)$role->name === (string)$authGroup['allyMemberRole']) {
155
+                            if ((string) $role->name === (string) $authGroup['allyMemberRole']) {
156 156
                                 $member->addRole($role);
157 157
                                 $allianceRoleSet = 1;
158 158
                             }
Please login to merge, or discard this patch.
src/lib/eveApi.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 function characterName($characterID)
102 102
 {
103 103
     $character = characterDetails($characterID);
104
-    $name = (string)$character['name'];
104
+    $name = (string) $character['name'];
105 105
 
106 106
     if (null === $name) { // Make sure it's always set.
107 107
         $name = 'Unknown';
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     $url = "https://esi.tech.ccp.is/latest/search/?search={$characterName}&categories=character&language=en-us&strict=true&datasource=tranquility";
122 122
     $json = file_get_contents($url);
123 123
     $data = json_decode($json, TRUE);
124
-    $id = (int)$data['character'][0];
124
+    $id = (int) $data['character'][0];
125 125
 
126 126
     if (null === $id) { // Make sure it's always set.
127 127
         $id = 'Unknown';
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
     $url = "https://esi.tech.ccp.is/latest/universe/systems/{$systemID}/";
159 159
     $json = file_get_contents($url);
160 160
     $data = json_decode($json, TRUE);
161
-    $name = (string)$data['solar_system_name'];
161
+    $name = (string) $data['solar_system_name'];
162 162
 
163 163
     if (null === $name) { // Make sure it's always set.
164 164
         $name = 'Unknown';
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
     $url = "https://esi.tech.ccp.is/latest/search/?search={$corpName}&categories=corporation&language=en-us&strict=true&datasource=tranquility";
179 179
     $json = file_get_contents($url);
180 180
     $data = json_decode($json, TRUE);
181
-    $id = (int)$data['corporation'][0];
181
+    $id = (int) $data['corporation'][0];
182 182
 
183 183
     if (null === $id) { // Make sure it's always set.
184 184
         $id = 'Unknown';
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 function corpName($corpID)
197 197
 {
198 198
     $corporation = corpDetails($corpID);
199
-    $name = (string)$corporation['corporation_name'];
199
+    $name = (string) $corporation['corporation_name'];
200 200
 
201 201
     if (null === $name) { // Make sure it's always set.
202 202
         $name = 'Unknown';
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
     $url = "https://esi.tech.ccp.is/latest/alliances/{$allianceID}/";
234 234
     $json = file_get_contents($url);
235 235
     $data = json_decode($json, TRUE);
236
-    $name = (string)$data['alliance_name'];
236
+    $name = (string) $data['alliance_name'];
237 237
 
238 238
     if (null === $name) { // Make sure it's always set.
239 239
         $name = 'Unknown';
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
     $url = "https://esi.tech.ccp.is/latest/search/?search={$systemName}&categories=solarsystem&language=en-us&strict=true&datasource=tranquility";
254 254
     $json = file_get_contents($url);
255 255
     $data = json_decode($json, TRUE);
256
-    $id = (int)$data['solarsystem'][0];
256
+    $id = (int) $data['solarsystem'][0];
257 257
 
258 258
     if (null === $id) { // Make sure it's always set.
259 259
         $id = 'Unknown';
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
     $url = "https://esi.tech.ccp.is/latest/universe/types/{$typeID}/";
273 273
     $json = file_get_contents($url);
274 274
     $data = json_decode($json, TRUE);
275
-    $name = (string)$data['type_name'];
275
+    $name = (string) $data['type_name'];
276 276
 
277 277
     if (null === $name) { // Make sure it's always set.
278 278
         $name = 'Unknown';
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
     $url = "https://www.fuzzwork.co.uk/api/typeid.php?typename={$typeName}";
293 293
     $json = file_get_contents($url);
294 294
     $data = json_decode($json, TRUE);
295
-    $id = (int)$data['typeID'];
295
+    $id = (int) $data['typeID'];
296 296
 
297 297
     if (null === $id) { // Make sure it's always set.
298 298
         $id = 'Unknown';
Please login to merge, or discard this patch.