Passed
Push — master ( 5359ca...7c7d88 )
by Bob
04:42 queued 01:59
created
src/plugins/onMessage/charInfo.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,6 @@
 block discarded – undo
24 24
  */
25 25
 
26 26
 use Discord\Discord;
27
-use Discord\Parts\Channel\Message;
28 27
 
29 28
 /**
30 29
  * @property  message
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
                 return $this->message->reply('**Error:** no data available');
99 99
             }
100 100
             // Get stats
101
-            $statsURL = 'https://beta.eve-kill.net/api/charInfo/characterID/'.urlencode($characterID).'/';
101
+            $statsURL = 'https://beta.eve-kill.net/api/charInfo/characterID/' . urlencode($characterID) . '/';
102 102
             $stats = json_decode(downloadData($statsURL), true);
103 103
 
104 104
             if (empty($stats)) {
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
             $ePeenSize = @$stats['ePeenSize'];
128 128
             $facepalms = @$stats['facepalms'];
129 129
             $lastUpdated = @$stats['lastUpdatedOnBackend'];
130
-            $url = 'https://beta.eve-kill.net/character/'.$stats['characterID'].'/';
130
+            $url = 'https://beta.eve-kill.net/character/' . $stats['characterID'] . '/';
131 131
 
132 132
 
133 133
             $msg = "```characterName: {$characterName}
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     {
164 164
         return [
165 165
             'name'        => 'char',
166
-            'trigger'     => [$this->config['bot']['trigger'].'char'],
166
+            'trigger'     => [$this->config['bot']['trigger'] . 'char'],
167 167
             'information' => 'Returns basic EVE Online data about a character from projectRena. To use simply type !char character_name',
168 168
         ];
169 169
     }
Please login to merge, or discard this patch.
src/plugins/onTick/notifications.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,6 @@
 block discarded – undo
24 24
  */
25 25
 
26 26
 
27
-use Discord\Discord;
28 27
 use Discord\Parts\Channel\Message;
29 28
 use Discord\Parts\Channel\Channel;
30 29
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 
433 433
             $this->logger->addInfo("Next Notification Check At: {$cacheTimer} EVE Time");
434 434
         } catch (Exception $e) {
435
-            $this->logger->addInfo('Notification Error: '.$e->getMessage());
435
+            $this->logger->addInfo('Notification Error: ' . $e->getMessage());
436 436
         }
437 437
     }
438 438
 
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
                 break;
481 481
         }
482 482
 
483
-        return json_decode(downloadData($downloadFrom.$typeID.'/'), true);
483
+        return json_decode(downloadData($downloadFrom . $typeID . '/'), true);
484 484
     }
485 485
 
486 486
     /**
Please login to merge, or discard this patch.
src/plugins/onTick/twitterOutput.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,6 @@
 block discarded – undo
23 23
  * SOFTWARE.
24 24
  */
25 25
 
26
-use Discord\Discord;
27
-use Discord\Parts\Channel\Message;
28 26
 use Discord\Parts\Channel\Channel;
29 27
 
30 28
 /**
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
 
106 106
                     $this->maxID = max($id, $this->maxID);
107 107
 
108
-                    $url = 'https://twitter.com/'.$screenName[0].'/status/'.$id;
109
-                    $message = ['message' => $text[0], 'postedAt' => $createdAt[0], 'postedBy' => $postedBy[0], 'screenName' => $screenName[0], 'url' => $url.$id[0]];
110
-                    $msg = '**@'.$screenName[0].'** ('.$message['postedBy'].') / '.htmlspecialchars_decode($message['message']);
108
+                    $url = 'https://twitter.com/' . $screenName[0] . '/status/' . $id;
109
+                    $message = ['message' => $text[0], 'postedAt' => $createdAt[0], 'postedBy' => $postedBy[0], 'screenName' => $screenName[0], 'url' => $url . $id[0]];
110
+                    $msg = '**@' . $screenName[0] . '** (' . $message['postedBy'] . ') / ' . htmlspecialchars_decode($message['message']);
111 111
                     $messages[$id] = $msg;
112 112
 
113 113
                     $continue = true;
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      */
143 143
     public function shortenUrl($url)
144 144
     {
145
-        return file_get_contents('http://is.gd/api.php?longurl='.$url);
145
+        return file_get_contents('http://is.gd/api.php?longurl=' . $url);
146 146
     }
147 147
 
148 148
     /**
Please login to merge, or discard this patch.
src/lib/Db.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
  */
25 25
 
26 26
 /**
27
- * @param null $db
27
+ * @param string|null $db
28 28
  * @return null|PDO
29 29
  */
30 30
 function openDB($db = null)
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@
 block discarded – undo
31 31
 function openDB($db = null)
32 32
 {
33 33
     if ($db == null) {
34
-        $db = __DIR__.'/../../database/dramiel.sqlite';
34
+        $db = __DIR__ . '/../../database/dramiel.sqlite';
35 35
     }
36 36
     if ($db == 'ccp') {
37
-        $db = __DIR__.'/../../database/ccpData.sqlite';
37
+        $db = __DIR__ . '/../../database/ccpData.sqlite';
38 38
     }
39 39
 
40 40
     $dsn = "sqlite:$db";
Please login to merge, or discard this patch.
src/plugins/onTick/evemails.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,6 @@
 block discarded – undo
23 23
  * SOFTWARE.
24 24
  */
25 25
 
26
-use Discord\Discord;
27
-use Discord\Parts\Channel\Message;
28 26
 use Discord\Parts\Channel\Channel;
29 27
 
30 28
 /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@
 block discarded – undo
153 153
                 $sentBy = $mail['senderName'];
154 154
                 $title = $mail['title'];
155 155
                 $sentDate = $mail['sentDate'];
156
-                $url = "https://api.eveonline.com/char/MailBodies.xml.aspx?keyID={$keyID}&vCode={$vCode}&characterID={$characterID}&ids=".$mail['messageID'];
156
+                $url = "https://api.eveonline.com/char/MailBodies.xml.aspx?keyID={$keyID}&vCode={$vCode}&characterID={$characterID}&ids=" . $mail['messageID'];
157 157
                 $content = strip_tags(str_replace('<br>', "\n", json_decode(json_encode(simplexml_load_string(downloadData($url), 'SimpleXMLElement', LIBXML_NOCDATA)))->result->rowset->row));
158 158
 
159 159
                 // Blank Content Check
Please login to merge, or discard this patch.
src/plugins/onTick/fileReader.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,6 @@
 block discarded – undo
24 24
  */
25 25
 
26 26
 
27
-use Discord\Discord;
28 27
 use Discord\Parts\Channel\Message;
29 28
 use Discord\Parts\Channel\Channel;
30 29
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
                         continue;
99 99
                     }
100 100
 
101
-                    $message .= $row.' | ';
101
+                    $message .= $row . ' | ';
102 102
                     usleep(300000);
103 103
                 }
104 104
 
@@ -107,10 +107,10 @@  discard block
 block discarded – undo
107 107
 
108 108
                 foreach ($this->channelConfig as $chanName => $chanConfig) {
109 109
                     if ($chanConfig['searchString'] == false) { // If no match was found, and searchString is false, just use that
110
-                        $message = $chanConfig['textStringPrepend'].' '.$message.' '.$chanConfig['textStringAppend'];
110
+                        $message = $chanConfig['textStringPrepend'] . ' ' . $message . ' ' . $chanConfig['textStringAppend'];
111 111
                         $channelID = $chanConfig['channelID'];
112 112
                     } elseif (stristr($message, $chanConfig['searchString'])) {
113
-                        $message = $chanConfig['textStringPrepend'].' '.$message.' '.$chanConfig['textStringAppend'];
113
+                        $message = $chanConfig['textStringPrepend'] . ' ' . $message . ' ' . $chanConfig['textStringAppend'];
114 114
                         $channelID = $chanConfig['channelID'];
115 115
                     }
116 116
                 }
Please login to merge, or discard this patch.
src/plugins/onMessage/about.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,6 @@
 block discarded – undo
23 23
  * SOFTWARE.
24 24
  */
25 25
 
26
-use Discord\Discord;
27
-use Discord\Parts\Channel\Message;
28 26
 use Discord\Parts\Channel\Channel;
29 27
 
30 28
 /**
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -99,14 +99,14 @@  discard block
 block discarded – undo
99 99
             $msg = '```
100 100
 Developer: Shibdib (In-game Name: Mr Twinkie)
101 101
 
102
-Current Version: '.$gitRevision['short'].'
103
-Current Branch: '.$gitBranch."
102
+Current Version: '.$gitRevision['short'] . '
103
+Current Branch: '.$gitBranch . "
104 104
 Github Repo: https://github.com/shibdib/Dramiel
105 105
 
106 106
 Statistics:
107 107
 Currently on {$this->info['guilds']} different discord servers.
108
-Up-time: ".$interval->y.' Year(s), '.$interval->m.' Month(s), '.$interval->d.' Days, '.$interval->h.' Hours, '.$interval->i.' Minutes, '.$interval->s.' seconds.
109
-Memory Usage: ~'.round(memory_get_usage() / 1024 / 1024, 3).'MB```';
108
+Up-time: " . $interval->y . ' Year(s), ' . $interval->m . ' Month(s), ' . $interval->d . ' Days, ' . $interval->h . ' Hours, ' . $interval->i . ' Minutes, ' . $interval->s . ' seconds.
109
+Memory Usage: ~'.round(memory_get_usage() / 1024 / 1024, 3) . 'MB```';
110 110
             $this->logger->addInfo("Sending about info to {$user}");
111 111
             $this->message->reply($msg);
112 112
         }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     {
120 120
         return [
121 121
             'name'        => 'about',
122
-            'trigger'     => [$this->config['bot']['trigger'].'about'],
122
+            'trigger'     => [$this->config['bot']['trigger'] . 'about'],
123 123
             'information' => "Shows information on the bot, who created it, what library it's using, revision, and other stats. Example: !about",
124 124
         ];
125 125
     }
Please login to merge, or discard this patch.
src/plugins/onMessage/auth.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,6 @@
 block discarded – undo
23 23
  * SOFTWARE.
24 24
  */
25 25
 
26
-use Discord\Discord;
27
-use Discord\Parts\Channel\Message;
28 26
 use Discord\Parts\Channel\Channel;
29 27
 
30 28
 /**
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             $result = selectPending($this->db, $this->dbUser, $this->dbPass, $this->dbName, $code);
116 116
 
117 117
             if (strlen($code) < 12) {
118
-                $this->message->reply('Invalid Code, check '.$this->config['bot']['trigger'].'help auth for more info.');
118
+                $this->message->reply('Invalid Code, check ' . $this->config['bot']['trigger'] . 'help auth for more info.');
119 119
 
120 120
                 return;
121 121
             }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                     foreach ($xml->result->rowset->row as $character) {
145 145
                         if ($character->attributes()->name != $userName) {
146 146
                             $this->message->reply('**Failure:** Your discord name must match your character name.');
147
-                            $this->logger->addInfo('User was denied due to not having the correct name '.$character->attributes()->name);
147
+                            $this->logger->addInfo('User was denied due to not having the correct name ' . $character->attributes()->name);
148 148
 
149 149
                             return;
150 150
                         }
@@ -162,8 +162,8 @@  discard block
 block discarded – undo
162 162
                                 $member->save();
163 163
                                 insertUser($this->db, $this->dbUser, $this->dbPass, $this->dbName, $userID, $charid, $eveName, 'corp');
164 164
                                 disableReg($this->db, $this->dbUser, $this->dbPass, $this->dbName, $code);
165
-                                $this->message->reply('**Success:** You have now been added to the '.$this->roleName.' group. To get more roles, talk to the CEO / Directors');
166
-                                $this->logger->addInfo('User authed and added to corp group '.$eveName);
165
+                                $this->message->reply('**Success:** You have now been added to the ' . $this->roleName . ' group. To get more roles, talk to the CEO / Directors');
166
+                                $this->logger->addInfo('User authed and added to corp group ' . $eveName);
167 167
 
168 168
                                 return;
169 169
                             }
@@ -179,21 +179,21 @@  discard block
 block discarded – undo
179 179
                                 $member->save();
180 180
                                 insertUser($this->db, $this->dbUser, $this->dbPass, $this->dbName, $userID, $charid, $eveName, 'ally');
181 181
                                 disableReg($this->db, $this->dbUser, $this->dbPass, $this->dbName, $code);
182
-                                $this->message->reply('**Success:** You have now been added to the '.$this->allyroleName.' group. To get more roles, talk to the CEO / Directors');
183
-                                $this->logger->addInfo('User authed and added to the alliance group '.$eveName);
182
+                                $this->message->reply('**Success:** You have now been added to the ' . $this->allyroleName . ' group. To get more roles, talk to the CEO / Directors');
183
+                                $this->logger->addInfo('User authed and added to the alliance group ' . $eveName);
184 184
 
185 185
                                 return;
186 186
                             }
187 187
                         }
188 188
                     }
189 189
                     $this->message->reply('**Failure:** There are no roles available for your corp/alliance.');
190
-                    $this->logger->addInfo('User was denied due to not being in the correct corp or alliance '.$eveName);
190
+                    $this->logger->addInfo('User was denied due to not being in the correct corp or alliance ' . $eveName);
191 191
 
192 192
                     return;
193 193
                 }
194 194
             }
195 195
             $this->message->reply('**Failure:** There was an issue with your code.');
196
-            $this->logger->addInfo('User was denied due to not being in the correct corp or alliance '.$userName);
196
+            $this->logger->addInfo('User was denied due to not being in the correct corp or alliance ' . $userName);
197 197
 
198 198
             return;
199 199
         }
@@ -206,8 +206,8 @@  discard block
 block discarded – undo
206 206
     {
207 207
         return [
208 208
             'name'        => 'auth',
209
-            'trigger'     => [$this->config['bot']['trigger'].'auth'],
210
-            'information' => 'SSO based auth system. '.$this->ssoUrl.' Visit the link and login with your main EVE account, select the correct character, and put the !auth <string> you receive in chat.',
209
+            'trigger'     => [$this->config['bot']['trigger'] . 'auth'],
210
+            'information' => 'SSO based auth system. ' . $this->ssoUrl . ' Visit the link and login with your main EVE account, select the correct character, and put the !auth <string> you receive in chat.',
211 211
         ];
212 212
     }
213 213
 
Please login to merge, or discard this patch.
src/plugins/onMessage/corpInfo.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,6 @@
 block discarded – undo
23 23
  * SOFTWARE.
24 24
  */
25 25
 
26
-use Discord\Discord;
27
-use Discord\Parts\Channel\Message;
28 26
 use Discord\Parts\Channel\Channel;
29 27
 
30 28
 /**
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             }
95 95
 
96 96
             // Get stats
97
-            $statsURL = 'https://beta.eve-kill.net/api/corpInfo/corporationID/'.urlencode($corpID).'/';
97
+            $statsURL = 'https://beta.eve-kill.net/api/corpInfo/corporationID/' . urlencode($corpID) . '/';
98 98
             $stats = json_decode(downloadData($statsURL), true);
99 99
 
100 100
             if (empty($stats)) {
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
             $memberCount = @$stats['memberArrayCount'];
115 115
             $superCaps = @count($stats['superCaps']);
116 116
             $ePeenSize = @$stats['ePeenSize'];
117
-            $url = 'https://beta.eve-kill.net/corporation/'.@$stats['corporationID'].'/';
117
+            $url = 'https://beta.eve-kill.net/corporation/' . @$stats['corporationID'] . '/';
118 118
 
119 119
 
120 120
             $msg = "```corporationName: {$corporationName}
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
     {
146 146
         return [
147 147
             'name'        => 'corp',
148
-            'trigger'     => [$this->config['bot']['trigger'].'corp'],
148
+            'trigger'     => [$this->config['bot']['trigger'] . 'corp'],
149 149
             'information' => 'Returns basic EVE Online data about a corporation from projectRena. To use simply type !corp corporation_name',
150 150
         ];
151 151
     }
Please login to merge, or discard this patch.