Passed
Branch dev (5844cc)
by
unknown
05:15 queued 02:37
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/plugins/onTick/getKillmailsRedis.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -141,17 +141,17 @@
 block discarded – undo
141 141
                 $attackerAllianceArray = array();
142 142
 
143 143
                 foreach ($kill['killmail']['attackers'] as $attacker) {
144
-                    $attackerCorpArray[] = (int)@$attacker['corporation']['id'];
145
-                    $attackerAllianceArray[] = (int)@$attacker['alliance']['id'];
144
+                    $attackerCorpArray[] = (int) @$attacker['corporation']['id'];
145
+                    $attackerAllianceArray[] = (int) @$attacker['alliance']['id'];
146 146
                 }
147 147
 
148
-                if ((int)@$kill['killmail']['victim']['corporation']['id'] === $kmGroup['corpID'] && (int)$kmGroup['corpID'] !== 0) {
148
+                if ((int) @$kill['killmail']['victim']['corporation']['id'] === $kmGroup['corpID'] && (int) $kmGroup['corpID'] !== 0) {
149 149
                     $corpLoss = true;
150
-                } elseif ((int)@$kill['killmail']['victim']['alliance']['id'] === $kmGroup['allianceID'] && (int)$kmGroup['allianceID'] !== 0) {
150
+                } elseif ((int) @$kill['killmail']['victim']['alliance']['id'] === $kmGroup['allianceID'] && (int) $kmGroup['allianceID'] !== 0) {
151 151
                     $allianceLoss = true;
152
-                } elseif (in_array((int)$kmGroup['corpID'], $attackerCorpArray) && (int)$kmGroup['corpID'] !== 0) {
152
+                } elseif (in_array((int) $kmGroup['corpID'], $attackerCorpArray) && (int) $kmGroup['corpID'] !== 0) {
153 153
                     $corpKill = true;
154
-                } elseif (in_array((int)$kmGroup['allianceID'], $attackerAllianceArray) && (int)$kmGroup['allianceID'] !== 0) {
154
+                } elseif (in_array((int) $kmGroup['allianceID'], $attackerAllianceArray) && (int) $kmGroup['allianceID'] !== 0) {
155 155
                     $allianceKill = true;
156 156
                 } else {
157 157
                     break;
Please login to merge, or discard this patch.
src/plugins/onTick/periodicStatusCheck.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
         //Crest
81 81
         $crestData = json_decode(downloadData('https://crest-tq.eveonline.com/'), true);
82 82
         $crestStatus = isset($crestData['serviceStatus']) ? $crestData['serviceStatus'] : 'offline';
83
-        $tqOnline = (int)@$crestData['userCount'];
83
+        $tqOnline = (int) @$crestData['userCount'];
84 84
         
85 85
         if ($lastStatus === $crestStatus) {
86 86
             // No change
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
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     if (null === $character) { // Make sure it's always set.
106 106
         return null;
107 107
     }
108
-    return (string)$character['name'];
108
+    return (string) $character['name'];
109 109
 }
110 110
 
111 111
 /**
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     try {
124 124
         $json = file_get_contents($url);
125 125
         $data = json_decode($json, TRUE);
126
-        $id = (int)$data['character'][0];
126
+        $id = (int) $data['character'][0];
127 127
 
128 128
     } catch (Exception $e) {
129 129
         $logger->error('EVE ESI Error: ' . $e->getMessage());
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
     try {
171 171
         $json = file_get_contents($url);
172 172
         $data = json_decode($json, TRUE);
173
-        $name = (string)$data['solar_system_name'];
173
+        $name = (string) $data['solar_system_name'];
174 174
 
175 175
     } catch (Exception $e) {
176 176
         $logger->error('EVE ESI Error: ' . $e->getMessage());
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
     try {
196 196
         $json = file_get_contents($url);
197 197
         $data = json_decode($json, TRUE);
198
-        $id = (int)$data['corporation'][0];
198
+        $id = (int) $data['corporation'][0];
199 199
 
200 200
     } catch (Exception $e) {
201 201
         $logger->error('EVE ESI Error: ' . $e->getMessage());
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 function corpName($corpID)
215 215
 {
216 216
     $corporation = corpDetails($corpID);
217
-    $name = (string)$corporation['corporation_name'];
217
+    $name = (string) $corporation['corporation_name'];
218 218
 
219 219
     if (null === $corporation) { // Make sure it's always set.
220 220
         return null;
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
     $url = "https://esi.tech.ccp.is/latest/alliances/{$allianceID}/";
257 257
     $json = file_get_contents($url);
258 258
     $data = json_decode($json, TRUE);
259
-    $name = (string)$data['alliance_name'];
259
+    $name = (string) $data['alliance_name'];
260 260
 
261 261
     if (null === $name) { // Make sure it's always set.
262 262
         $name = 'Unknown';
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
     $url = "https://esi.tech.ccp.is/latest/search/?search={$systemName}&categories=solarsystem&language=en-us&strict=true&datasource=tranquility";
277 277
     $json = file_get_contents($url);
278 278
     $data = json_decode($json, TRUE);
279
-    $id = (int)$data['solarsystem'][0];
279
+    $id = (int) $data['solarsystem'][0];
280 280
 
281 281
     if (null === $id) { // Make sure it's always set.
282 282
         $id = 'Unknown';
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
     $url = "https://esi.tech.ccp.is/latest/universe/types/{$typeID}/";
296 296
     $json = file_get_contents($url);
297 297
     $data = json_decode($json, TRUE);
298
-    $name = (string)$data['type_name'];
298
+    $name = (string) $data['type_name'];
299 299
 
300 300
     if (null === $name) { // Make sure it's always set.
301 301
         $name = 'Unknown';
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
     $url = "https://www.fuzzwork.co.uk/api/typeid.php?typename={$typeName}";
316 316
     $json = file_get_contents($url);
317 317
     $data = json_decode($json, TRUE);
318
-    $id = (int)$data['typeID'];
318
+    $id = (int) $data['typeID'];
319 319
 
320 320
     if (null === $id) { // Make sure it's always set.
321 321
         $id = 'Unknown';
Please login to merge, or discard this patch.
src/plugins/onMessage/auth.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
                         return null;
127 127
                     }
128 128
                     $corpTicker = $corpDetails['ticker'];
129
-                    $corpName = (string)$corpDetails['corporation_name'];
129
+                    $corpName = (string) $corpDetails['corporation_name'];
130 130
                     if (null !== $corpTicker) {
131 131
                         addCorpInfo($corpID, $corpTicker, $corpName);
132 132
                     }
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
                     //Check if corpID matches
157 157
                     if ($corpID === $authGroup['corpID']) {
158 158
                         foreach ($roles as $role) {
159
-                            if ((string)$role->name === (string)$authGroup['corpMemberRole']) {
159
+                            if ((string) $role->name === (string) $authGroup['corpMemberRole']) {
160 160
                                 $member->addRole($role);
161 161
                                 $role = 'corp';
162 162
                             }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
                     //Check if allianceID matches
166 166
                     if ($allianceID === $authGroup['allianceID'] && $authGroup['allianceID'] != 0) {
167 167
                         foreach ($roles as $role) {
168
-                            if ((string)$role->name === (string)$authGroup['allyMemberRole']) {
168
+                            if ((string) $role->name === (string) $authGroup['allyMemberRole']) {
169 169
                                 $member->addRole($role);
170 170
                                 $role = 'ally';
171 171
                             }
@@ -176,23 +176,23 @@  discard block
 block discarded – undo
176 176
                         $allianceContacts = getContacts($allianceID);
177 177
                         $corpContacts = getContacts($corpID);
178 178
                         foreach ($roles as $role) {
179
-                            if ((@(int)$allianceContacts['standings'] === 5 || @(int)$corpContacts['standings'] === 5) && (string)$role->name === (string)$this->config['plugins']['auth']['standings']['plus5Role']) {
179
+                            if ((@(int) $allianceContacts['standings'] === 5 || @(int) $corpContacts['standings'] === 5) && (string) $role->name === (string) $this->config['plugins']['auth']['standings']['plus5Role']) {
180 180
                                 $member->addRole($role);
181 181
                                 $role = 'blue';
182 182
                             }
183
-                            if ((@(int)$allianceContacts['standings'] === 10 || @(int)$corpContacts['standings'] === 10) && (string)$role->name === (string)$this->config['plugins']['auth']['standings']['plus10Role']) {
183
+                            if ((@(int) $allianceContacts['standings'] === 10 || @(int) $corpContacts['standings'] === 10) && (string) $role->name === (string) $this->config['plugins']['auth']['standings']['plus10Role']) {
184 184
                                 $member->addRole($role);
185 185
                                 $role = 'blue';
186 186
                             }
187
-                            if ((@(int)$allianceContacts['standings'] === 0 || @(int)$corpContacts['standings'] === 0 || (@(int)$allianceContacts['standings'] && @(int)$corpContacts['standings'] === null || '')) && (string)$role->name === (string)$this->config['plugins']['auth']['standings']['neutralRole']) {
187
+                            if ((@(int) $allianceContacts['standings'] === 0 || @(int) $corpContacts['standings'] === 0 || (@(int) $allianceContacts['standings'] && @(int) $corpContacts['standings'] === null || '')) && (string) $role->name === (string) $this->config['plugins']['auth']['standings']['neutralRole']) {
188 188
                                 $member->addRole($role);
189 189
                                 $role = 'neut';
190 190
                             }
191
-                            if ((@(int)$allianceContacts['standings'] === -5 || @(int)$corpContacts['standings'] === -5) && (string)$role->name === (string)$this->config['plugins']['auth']['standings']['minus5Role']) {
191
+                            if ((@(int) $allianceContacts['standings'] === -5 || @(int) $corpContacts['standings'] === -5) && (string) $role->name === (string) $this->config['plugins']['auth']['standings']['minus5Role']) {
192 192
                                 $member->addRole($role);
193 193
                                 $role = 'red';
194 194
                             }
195
-                            if ((@(int)$allianceContacts['standings'] === -10 || @(int)$corpContacts['standings'] === -10) && (string)$role->name === (string)$this->config['plugins']['auth']['standings']['minus10Role']) {
195
+                            if ((@(int) $allianceContacts['standings'] === -10 || @(int) $corpContacts['standings'] === -10) && (string) $role->name === (string) $this->config['plugins']['auth']['standings']['minus10Role']) {
196 196
                                 $member->addRole($role);
197 197
                                 $role = 'red';
198 198
                             }
Please login to merge, or discard this patch.
config/config.new.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -163,8 +163,8 @@
 block discarded – undo
163 163
             )
164 164
         ),
165 165
         'standings' => array(
166
-            'enabled' => 'false',//set to true if you want to allow people to auth based off of corp/alliance standings
167
-            'apiKey' => 'user1',//enter the KEYID for whatever above api you'd like to base standings off of
166
+            'enabled' => 'false', //set to true if you want to allow people to auth based off of corp/alliance standings
167
+            'apiKey' => 'user1', //enter the KEYID for whatever above api you'd like to base standings off of
168 168
             'plus10Role' => '',
169 169
             'plus5Role' => '',
170 170
             'neutralRole' => '',
Please login to merge, or discard this patch.
src/plugins/onTick/authCheck.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -165,10 +165,10 @@  discard block
 block discarded – undo
165 165
         //Set corp/ally id arrays
166 166
         foreach ($this->authGroups as $authGroup) {
167 167
             if ($authGroup['corpID'] !== 0) {
168
-                $corpArray[] = (int)$authGroup['corpID'];
168
+                $corpArray[] = (int) $authGroup['corpID'];
169 169
             }
170 170
             if ($authGroup['allianceID'] !== 0) {
171
-                $allianceArray[] = (int)$authGroup['allianceID'];
171
+                $allianceArray[] = (int) $authGroup['allianceID'];
172 172
             }
173 173
         }
174 174
 
@@ -208,11 +208,11 @@  discard block
 block discarded – undo
208 208
                     if ($role === 'red' && ($allianceContacts['standings'] || $corpContacts['standings'] === -5 || -10)) {
209 209
                         $standings = 1;
210 210
                     }
211
-                    if ($role === 'neut' && ($allianceContacts['standings'] || $corpContacts['standings'] === 0 || (@(int)$allianceContacts['standings'] && @(int)$corpContacts['standings'] === null || ''))) {
211
+                    if ($role === 'neut' && ($allianceContacts['standings'] || $corpContacts['standings'] === 0 || (@(int) $allianceContacts['standings'] && @(int) $corpContacts['standings'] === null || ''))) {
212 212
                         $standings = 1;
213 213
                     }
214 214
                 }
215
-                if (!in_array((int)$allianceID, $allianceArray) && !in_array((int)$corporationID, $corpArray) && null === $standings) {
215
+                if (!in_array((int) $allianceID, $allianceArray) && !in_array((int) $corporationID, $corpArray) && null === $standings) {
216 216
                     // Deactivate user in database
217 217
                     $sql = "UPDATE authUsers SET active='no' WHERE discordID='$discordID'";
218 218
                     $this->logger->addInfo("AuthCheck: {$eveName} account has been deactivated as they are no longer in a correct corp/alliance.");
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
         $guild = $this->discord->guilds->get('id', $this->guildID);
319 319
 
320 320
         //Get name queue status
321
-        $x = (int)getPermCache('nameQueueState');
321
+        $x = (int) getPermCache('nameQueueState');
322 322
 
323 323
         //Establish connection to mysql
324 324
         $conn = new mysqli($this->db, $this->dbUser, $this->dbPass, $this->dbName);
@@ -384,10 +384,10 @@  discard block
 block discarded – undo
384 384
                     }
385 385
                     $nick = null;
386 386
                     if (null !== @$corpInfo['corpTicker']) {
387
-                        $corpTicker = (string)$corpInfo['corpTicker'];
387
+                        $corpTicker = (string) $corpInfo['corpTicker'];
388 388
                         if ($this->nameEnforce === 'true') {
389 389
                             $nick = "[{$corpTicker}] {$eveName}";
390
-                        } elseif ((string)$nickName === "[{$corpTicker}]") {
390
+                        } elseif ((string) $nickName === "[{$corpTicker}]") {
391 391
                             $nick = "[{$corpTicker}] {$userName}";
392 392
                         } elseif (strpos($nickName, $corpTicker) === false) {
393 393
                             $nick = "[{$corpTicker}] {$nickName}";
@@ -408,11 +408,11 @@  discard block
 block discarded – undo
408 408
                     if (@$corpTicker === 'U') {
409 409
                         continue;
410 410
                     }
411
-                    $corpName = (string)$corporationDetails['corporation_name'];
411
+                    $corpName = (string) $corporationDetails['corporation_name'];
412 412
                     if (null !== $corpTicker) {
413 413
                         if ($this->nameEnforce === 'true') {
414 414
                             $nick = "[{$corpTicker}] {$eveName}";
415
-                        } elseif ((string)$nickName === "[{$corpTicker}]") {
415
+                        } elseif ((string) $nickName === "[{$corpTicker}]") {
416 416
                             $nick = "[{$corpTicker}] {$userName}";
417 417
                         } elseif (strpos($nickName, $corpTicker) === false) {
418 418
                             $nick = "[{$corpTicker}] {$nickName}";
@@ -446,14 +446,14 @@  discard block
 block discarded – undo
446 446
     private function standingsUpdate()
447 447
     {
448 448
         foreach ($this->apiKey as $apiKey) {
449
-            if ((string)$apiKey['keyID'] === (string)$this->config['plugins']['auth']['standings']['apiKey']) {
449
+            if ((string) $apiKey['keyID'] === (string) $this->config['plugins']['auth']['standings']['apiKey']) {
450 450
                 $url = "https://api.eveonline.com/char/ContactList.xml.aspx?keyID={$apiKey['keyID']}&vCode={$apiKey['vCode']}&characterID={$apiKey['characterID']}";
451 451
                 $xml = makeApiRequest($url);
452 452
                 if (empty($xml)) {
453 453
                     return null;
454 454
                 }
455 455
                 foreach ($xml->result->rowset as $contactType) {
456
-                    if ((string)$contactType->attributes()->name === 'corporateContactList' || 'allianceContactList') {
456
+                    if ((string) $contactType->attributes()->name === 'corporateContactList' || 'allianceContactList') {
457 457
                         foreach ($contactType->row as $contact) {
458 458
                             if (null !== $contact['contactID'] && $contact['contactName'] && $contact['standing']) {
459 459
                                 addContactInfo($contact['contactID'], $contact['contactName'], $contact['standing']);
Please login to merge, or discard this patch.