Passed
Pull Request — master (#198)
by
unknown
03:01
created
src/plugins/onMessage/motd.php 1 patch
Indentation   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -25,80 +25,80 @@
 block discarded – undo
25 25
 /**
26 26
  * @property  message
27 27
  */
28
-	class motd {
29
-		public $config;
30
-		public $discord;
31
-		public $logger;
32
-		public $message;
33
-		private $excludeChannel;
34
-		private $triggers;
35
-		public function init($config, $discord, $logger) {
36
-			$this->config = $config;
37
-			$this->discord = $discord;
38
-			$this->logger = $logger;
39
-			$this->excludeChannel = $this->config['bot']['restrictedChannels'];
40
-			$this->triggers[] = $this->config['bot']['trigger'] . 'motd';
41
-			$this->triggers[] = $this->config['bot']['trigger'] . 'Motd';
42
-			$this->triggers[] = $this->config['bot']['trigger'] . 'MOTD';
43
-			$this->keyID = $config['plugins']['motd']['keyID'];
44
-			$this->vCode = $config['plugins']['motd']['vCode'];
45
-			$this->characterID = $config['plugins']['motd']['characterID'];
46
-			$this->channelname = $config['plugins']['motd']['channelname'];
47
-		}
48
-		public function onMessage($msgData, $message) {
49
-			$channelID = (int) $msgData['message']['channelID'];
50
-			if (in_array($channelID, $this->excludeChannel, true)) {
51
-				return null;
52
-			}
53
-			$this->message = $message;
54
-			$user = $msgData['message']['from'];
55
-			$message = $msgData['message']['message'];
56
-			$data = command($message, $this->information() ['trigger'], $this->config['bot']['trigger']);
57
-			if (isset($data['trigger'])) {
58
-				$keyID = $this->keyID;
59
-				$vCode = $this->vCode;
60
-				$characterID = $this->characterID;
61
-				$channelname = $this->channelname;
28
+    class motd {
29
+        public $config;
30
+        public $discord;
31
+        public $logger;
32
+        public $message;
33
+        private $excludeChannel;
34
+        private $triggers;
35
+        public function init($config, $discord, $logger) {
36
+            $this->config = $config;
37
+            $this->discord = $discord;
38
+            $this->logger = $logger;
39
+            $this->excludeChannel = $this->config['bot']['restrictedChannels'];
40
+            $this->triggers[] = $this->config['bot']['trigger'] . 'motd';
41
+            $this->triggers[] = $this->config['bot']['trigger'] . 'Motd';
42
+            $this->triggers[] = $this->config['bot']['trigger'] . 'MOTD';
43
+            $this->keyID = $config['plugins']['motd']['keyID'];
44
+            $this->vCode = $config['plugins']['motd']['vCode'];
45
+            $this->characterID = $config['plugins']['motd']['characterID'];
46
+            $this->channelname = $config['plugins']['motd']['channelname'];
47
+        }
48
+        public function onMessage($msgData, $message) {
49
+            $channelID = (int) $msgData['message']['channelID'];
50
+            if (in_array($channelID, $this->excludeChannel, true)) {
51
+                return null;
52
+            }
53
+            $this->message = $message;
54
+            $user = $msgData['message']['from'];
55
+            $message = $msgData['message']['message'];
56
+            $data = command($message, $this->information() ['trigger'], $this->config['bot']['trigger']);
57
+            if (isset($data['trigger'])) {
58
+                $keyID = $this->keyID;
59
+                $vCode = $this->vCode;
60
+                $characterID = $this->characterID;
61
+                $channelname = $this->channelname;
62 62
 
63 63
         $urlChar = "https://api.eveonline.com/char/ChatChannels.xml.aspx?keyID=$keyID&vCode=$vCode&characterID=$characterID";
64
-				$data = file_get_contents($urlChar);
65
-				$list = new SimpleXMLElement($data);
64
+                $data = file_get_contents($urlChar);
65
+                $list = new SimpleXMLElement($data);
66 66
 				
67 67
 				
68
-				foreach ($list->result->rowset->row as $row) {
69
-					$channeln = $row["displayName"];
68
+                foreach ($list->result->rowset->row as $row) {
69
+                    $channeln = $row["displayName"];
70 70
 					
71
-					if ($channeln == $channelname) {
72
-					//scrub the motd, then break it into 1900 chars or less. Limit is 2000 and want to leave room for the name of the person being replied too
73
-					$comment = $row["motd"];
74
-          $comment = str_replace("<BR>", "\n", $comment);
75
-          $comment = str_replace("<br>", "\n", $comment);
76
-          $comment = str_replace("<u>", "__", $comment);
77
-          $comment = str_replace("</u>", "__", $comment);	
78
-          $comment = str_replace("<b>", "**", $comment);	
79
-          $comment = str_replace("</b>", "**", $comment);	
80
-          $comment = str_replace("<i>", "*", $comment);	
81
-          $comment = str_replace("</i>", "*", $comment);
82
-					$comment = str_replace("&amp;", "&", $comment);
83
-          $comment = strip_tags($comment);
84
-					$comment2 = str_split($comment, 1900);
71
+                    if ($channeln == $channelname) {
72
+                    //scrub the motd, then break it into 1900 chars or less. Limit is 2000 and want to leave room for the name of the person being replied too
73
+                    $comment = $row["motd"];
74
+            $comment = str_replace("<BR>", "\n", $comment);
75
+            $comment = str_replace("<br>", "\n", $comment);
76
+            $comment = str_replace("<u>", "__", $comment);
77
+            $comment = str_replace("</u>", "__", $comment);	
78
+            $comment = str_replace("<b>", "**", $comment);	
79
+            $comment = str_replace("</b>", "**", $comment);	
80
+            $comment = str_replace("<i>", "*", $comment);	
81
+            $comment = str_replace("</i>", "*", $comment);
82
+                    $comment = str_replace("&amp;", "&", $comment);
83
+            $comment = strip_tags($comment);
84
+                    $comment2 = str_split($comment, 1900);
85 85
 					
86
-					$this->message->reply("\n $comment2[0]");
87
-						if (!empty($comment2[1])) {
88
-							$this->message->reply("\n $comment2[1]");
89
-						}
90
-						if (!empty($comment2[2])) {
91
-							$this->message->reply("\n $comment2[2]");
92
-						}
93
-						if (!empty($comment2[3])) {
94
-							$this->message->reply("\n $comment2[3]");
95
-						}
96
-					}
97
-				}
98
-			}
99
-		}
100
-		public function information() {
86
+                    $this->message->reply("\n $comment2[0]");
87
+                        if (!empty($comment2[1])) {
88
+                            $this->message->reply("\n $comment2[1]");
89
+                        }
90
+                        if (!empty($comment2[2])) {
91
+                            $this->message->reply("\n $comment2[2]");
92
+                        }
93
+                        if (!empty($comment2[3])) {
94
+                            $this->message->reply("\n $comment2[3]");
95
+                        }
96
+                    }
97
+                }
98
+            }
99
+        }
100
+        public function information() {
101 101
             return array('name' => 'motd', 'trigger' => $this->triggers, 'information' => 'Displays the MOTD, useful for seeing information displayed there when not in-game.');
102
-		}
103
-	}
102
+        }
103
+    }
104 104
 ?>
Please login to merge, or discard this patch.
Dramiel.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,8 @@
 block discarded – undo
57 57
 //Check we are not running on a 32bit platform
58 58
 if(PHP_INT_SIZE == 4)
59 59
 {
60
-	$logger->error('32bit PHP found, if you are running a 64bit OS please install 64bit PHP');
61
-	die();
60
+    $logger->error('32bit PHP found, if you are running a 64bit OS please install 64bit PHP');
61
+    die();
62 62
 }
63 63
 
64 64
 // Require the config
Please login to merge, or discard this patch.
src/plugins/onTick/authCheck.php 1 patch
Braces   +23 added lines, -14 removed lines patch added patch discarded remove patch
@@ -177,8 +177,9 @@  discard block
 block discarded – undo
177 177
             for ($i=0; $i<3; $i++) {
178 178
                 $character = characterDetails($charID);
179 179
                 //if (isset($character['corporation_id']) && in_array($character['corporation_id'], $corpArray))
180
-                if (!is_null($character))
181
-                    break;
180
+                if (!is_null($character)) {
181
+                                    break;
182
+                }
182 183
                 //Postpone check if ESI is down to prevent timeouts
183 184
                 if (isset($character['error']) && $character['error'] === 'The datasource tranquility is temporarily unavailable') {
184 185
                     $this->logger->addInfo('AuthCheck: The datasource tranquility is temporarily unavailable, check canceled.');
@@ -197,8 +198,9 @@  discard block
 block discarded – undo
197 198
             // alliance membership check
198 199
             for ($i=0; $i<3; $i++) {
199 200
                 $corporationDetails = corpDetails($corporationID);
200
-                if (!is_null($corporationDetails))
201
-                    break;
201
+                if (!is_null($corporationDetails)) {
202
+                                    break;
203
+                }
202 204
             }
203 205
             if (is_null($corporationDetails) || isset($corporationDetails['error'])) {
204 206
                 $this->logger->addInfo('AuthCheck: corpDetails lookup failed.');
@@ -223,8 +225,10 @@  discard block
 block discarded – undo
223 225
                     $standings = 1;
224 226
                 }
225 227
             }
226
-            if ($standings)
227
-                continue; //keep the user based on standings
228
+            if ($standings) {
229
+                            continue;
230
+            }
231
+            //keep the user based on standings
228 232
 
229 233
             // User failed all checks, deactivate user in database
230 234
             $sql = "UPDATE authUsers SET active='no' WHERE discordID='$discordID'";
@@ -294,8 +298,10 @@  discard block
 block discarded – undo
294 298
 
295 299
             } while (!isset($character['corporation_id']));
296 300
             $corporationID = $character['corporation_id'];
297
-            if (in_array($corporationID, $corpArray))
298
-                continue; // user is in a valid corp, stop checking
301
+            if (in_array($corporationID, $corpArray)) {
302
+                            continue;
303
+            }
304
+            // user is in a valid corp, stop checking
299 305
 
300 306
             $timeout = 0;
301 307
             do {
@@ -306,8 +312,10 @@  discard block
 block discarded – undo
306 312
                 $timeout++;
307 313
                 $corporationDetails = corpDetails($corporationID);
308 314
             } while (!isset($corporationDetails));
309
-            if (isset($corporationDetails['alliance_id']) && in_array($corporationDetails['alliance_id'], $allianceArray))
310
-                continue; // user is in a valid alliance, stop checking
315
+            if (isset($corporationDetails['alliance_id']) && in_array($corporationDetails['alliance_id'], $allianceArray)) {
316
+                            continue;
317
+            }
318
+            // user is in a valid alliance, stop checking
311 319
 
312 320
             //check if user authed based on standings
313 321
             $standings = null;
@@ -324,8 +332,10 @@  discard block
 block discarded – undo
324 332
                     $standings = 1;
325 333
                 }
326 334
             }
327
-            if ($standings)
328
-                continue; //keep the user based on standings
335
+            if ($standings) {
336
+                            continue;
337
+            }
338
+            //keep the user based on standings
329 339
 
330 340
             // User failed all checks, deactivate user in database
331 341
             $sql = "UPDATE authUsers SET active='no' WHERE discordID='$discordID'";
@@ -467,8 +477,7 @@  discard block
 block discarded – undo
467 477
                     while (null === $character) { //try 10 times to pull characterDetails
468 478
                         if ($timeout > 9) {
469 479
                             continue;
470
-                        }
471
-                        else{
480
+                        } else{
472 481
                             $character = characterDetails($charID);
473 482
                             $timeout++;
474 483
                         }
Please login to merge, or discard this patch.