Completed
Pull Request — newinternal (#285)
by Simon
07:17 queued 04:17
created
includes/PdoDatabase.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
             }
51 51
             catch (PDOException $ex) {
52 52
                 // wrap around any potential stack traces which may include passwords
53
-                throw new EnvironmentException("Error connecting to database '$connectionName': " . $ex->getMessage());
53
+                throw new EnvironmentException("Error connecting to database '$connectionName': ".$ex->getMessage());
54 54
             }
55 55
 
56 56
             $databaseObject->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
Please login to merge, or discard this patch.
includes/ExceptionHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
         $errorId = sha1($state);
59 59
 
60 60
         // Save the error for later analysis
61
-        file_put_contents($siteConfiguration->getErrorLog() . '/' . $errorId . '.log', $state);
61
+        file_put_contents($siteConfiguration->getErrorLog().'/'.$errorId.'.log', $state);
62 62
 
63 63
         // clear and discard any content that's been saved to the output buffer
64 64
         if (ob_get_level() > 0) {
Please login to merge, or discard this patch.
includes/Validation/RequestValidationHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@
 block discarded – undo
120 120
         }
121 121
 
122 122
         // username can't contain #@/<>[]|{}
123
-        if (preg_match("/[" . preg_quote("#@/<>[]|{}", "/") . "]/", $this->request->getName()) === 1) {
123
+        if (preg_match("/[".preg_quote("#@/<>[]|{}", "/")."]/", $this->request->getName()) === 1) {
124 124
             $errorList[ValidationError::NAME_INVALIDCHAR] = new ValidationError(ValidationError::NAME_INVALIDCHAR);
125 125
         }
126 126
 
Please login to merge, or discard this patch.
includes/Router/RequestRouter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -358,7 +358,7 @@
 block discarded – undo
358 358
         $routeMap = $this->routePathSegments($classSegment, $requestedAction);
359 359
 
360 360
         if ($routeMap[0] === Page404::class) {
361
-            $routeMap = $this->routeSinglePathSegment($classSegment . '/' . $requestedAction);
361
+            $routeMap = $this->routeSinglePathSegment($classSegment.'/'.$requestedAction);
362 362
         }
363 363
 
364 364
         return $routeMap;
Please login to merge, or discard this patch.
includes/AutoLoader.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -25,14 +25,14 @@
 block discarded – undo
25 25
         }
26 26
 
27 27
         $paths = array(
28
-            __DIR__ . '/' . $class . ".php",
29
-            __DIR__ . '/DataObjects/' . $class . ".php",
30
-            __DIR__ . '/Providers/' . $class . ".php",
31
-            __DIR__ . '/Providers/Interfaces/' . $class . ".php",
32
-            __DIR__ . '/Validation/' . $class . ".php",
33
-            __DIR__ . '/Helpers/' . $class . ".php",
34
-            __DIR__ . '/Helpers/Interfaces/' . $class . ".php",
35
-            __DIR__ . '/' . $class . ".php",
28
+            __DIR__.'/'.$class.".php",
29
+            __DIR__.'/DataObjects/'.$class.".php",
30
+            __DIR__.'/Providers/'.$class.".php",
31
+            __DIR__.'/Providers/Interfaces/'.$class.".php",
32
+            __DIR__.'/Validation/'.$class.".php",
33
+            __DIR__.'/Helpers/'.$class.".php",
34
+            __DIR__.'/Helpers/Interfaces/'.$class.".php",
35
+            __DIR__.'/'.$class.".php",
36 36
         );
37 37
 
38 38
         foreach ($paths as $file) {
Please login to merge, or discard this patch.
includes/StringFunctions.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
             return ucfirst($string);
81 81
         }
82 82
         else {
83
-            return mb_strtoupper(mb_substr($string, 0, 1)) . mb_substr($string, 1);
83
+            return mb_strtoupper(mb_substr($string, 0, 1)).mb_substr($string, 1);
84 84
         }
85 85
     }
86 86
 }
Please login to merge, or discard this patch.
includes/ConsoleTasks/RecreateTrustedIpTableTask.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -114,13 +114,13 @@
 block discarded – undo
114 114
             }
115 115
 
116 116
             // match a regex of an CIDR range:
117
-            $ipcidr = '@' . RegexConstants::IPV4 . RegexConstants::IPV4_CIDR . '@';
117
+            $ipcidr = '@'.RegexConstants::IPV4.RegexConstants::IPV4_CIDR.'@';
118 118
             if (preg_match($ipcidr, $line) === 1) {
119 119
                 $iprange[] = $line;
120 120
                 continue;
121 121
             }
122 122
 
123
-            $ipnoncidr = '@' . RegexConstants::IPV4 . '@';
123
+            $ipnoncidr = '@'.RegexConstants::IPV4.'@';
124 124
             if (preg_match($ipnoncidr, $line) === 1) {
125 125
                 $ip[] = $line;
126 126
                 continue;
Please login to merge, or discard this patch.
includes/Helpers/IrcNotificationHelper.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         $blacklist = array("DCC", "CCTP", "PRIVMSG");
90 90
         $message = str_replace($blacklist, "(IRC Blacklist)", $message); // Lets stop DCC etc
91 91
 
92
-        $msg = IrcColourCode::RESET . IrcColourCode::BOLD . "[$instanceName]" . IrcColourCode::RESET . ": $message";
92
+        $msg = IrcColourCode::RESET.IrcColourCode::BOLD."[$instanceName]".IrcColourCode::RESET.": $message";
93 93
 
94 94
         try {
95 95
             $notification = new Notification();
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      */
128 128
     public function userApproved(User $user)
129 129
     {
130
-        $this->send("{$user->getUsername()} approved by " . $this->currentUser->getUsername());
130
+        $this->send("{$user->getUsername()} approved by ".$this->currentUser->getUsername());
131 131
     }
132 132
 
133 133
     /**
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
      */
138 138
     public function userPromoted(User $user)
139 139
     {
140
-        $this->send("{$user->getUsername()} promoted to tool admin by " . $this->currentUser->getUsername());
140
+        $this->send("{$user->getUsername()} promoted to tool admin by ".$this->currentUser->getUsername());
141 141
     }
142 142
 
143 143
     /**
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      */
149 149
     public function userDeclined(User $user, $reason)
150 150
     {
151
-        $this->send("{$user->getUsername()} declined by " . $this->currentUser->getUsername() . " ($reason)");
151
+        $this->send("{$user->getUsername()} declined by ".$this->currentUser->getUsername()." ($reason)");
152 152
     }
153 153
 
154 154
     /**
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
      */
160 160
     public function userDemoted(User $user, $reason)
161 161
     {
162
-        $this->send("{$user->getUsername()} demoted by " . $this->currentUser->getUsername() . " ($reason)");
162
+        $this->send("{$user->getUsername()} demoted by ".$this->currentUser->getUsername()." ($reason)");
163 163
     }
164 164
 
165 165
     /**
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
      */
171 171
     public function userSuspended(User $user, $reason)
172 172
     {
173
-        $this->send("{$user->getUsername()} suspended by " . $this->currentUser->getUsername() . " ($reason)");
173
+        $this->send("{$user->getUsername()} suspended by ".$this->currentUser->getUsername()." ($reason)");
174 174
     }
175 175
 
176 176
     /**
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
      */
181 181
     public function userPrefChange(User $user)
182 182
     {
183
-        $this->send("{$user->getUsername()}'s preferences were changed by " . $this->currentUser->getUsername());
183
+        $this->send("{$user->getUsername()}'s preferences were changed by ".$this->currentUser->getUsername());
184 184
     }
185 185
 
186 186
     /**
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
      */
192 192
     public function userRenamed(User $user, $old)
193 193
     {
194
-        $this->send($this->currentUser->getUsername() . " renamed $old to {$user->getUsername()}");
194
+        $this->send($this->currentUser->getUsername()." renamed $old to {$user->getUsername()}");
195 195
     }
196 196
 
197 197
     #endregion
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
      */
204 204
     public function siteNoticeEdited()
205 205
     {
206
-        $this->send("Site notice edited by " . $this->currentUser->getUsername());
206
+        $this->send("Site notice edited by ".$this->currentUser->getUsername());
207 207
     }
208 208
     #endregion
209 209
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
      */
216 216
     public function welcomeTemplateCreated(WelcomeTemplate $template)
217 217
     {
218
-        $this->send("Welcome template {$template->getId()} created by " . $this->currentUser->getUsername());
218
+        $this->send("Welcome template {$template->getId()} created by ".$this->currentUser->getUsername());
219 219
     }
220 220
 
221 221
     /**
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
      */
226 226
     public function welcomeTemplateDeleted($templateid)
227 227
     {
228
-        $this->send("Welcome template {$templateid} deleted by " . $this->currentUser->getUsername());
228
+        $this->send("Welcome template {$templateid} deleted by ".$this->currentUser->getUsername());
229 229
     }
230 230
 
231 231
     /**
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
      */
236 236
     public function welcomeTemplateEdited(WelcomeTemplate $template)
237 237
     {
238
-        $this->send("Welcome template {$template->getId()} edited by " . $this->currentUser->getUsername());
238
+        $this->send("Welcome template {$template->getId()} edited by ".$this->currentUser->getUsername());
239 239
     }
240 240
 
241 241
     #endregion
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
             $duration = "indefinitely";
253 253
         }
254 254
         else {
255
-            $duration = "until " . date("F j, Y, g:i a", $ban->getDuration());
255
+            $duration = "until ".date("F j, Y, g:i a", $ban->getDuration());
256 256
         }
257 257
 
258 258
         $username = $this->currentUser->getUsername();
@@ -268,8 +268,8 @@  discard block
 block discarded – undo
268 268
      */
269 269
     public function unbanned(Ban $ban, $unbanreason)
270 270
     {
271
-        $this->send($ban->getTarget() . " unbanned by " . $this->currentUser
272
-                ->getUsername() . " (" . $unbanreason . ")");
271
+        $this->send($ban->getTarget()." unbanned by ".$this->currentUser
272
+                ->getUsername()." (".$unbanreason.")");
273 273
     }
274 274
 
275 275
     #endregion
@@ -284,15 +284,15 @@  discard block
 block discarded – undo
284 284
     public function requestReceived(Request $request)
285 285
     {
286 286
         $this->send(
287
-            IrcColourCode::DARK_GREY . "[["
288
-            . IrcColourCode::DARK_GREEN . "acc:"
289
-            . IrcColourCode::ORANGE . $request->getId()
290
-            . IrcColourCode::DARK_GREY . "]]"
291
-            . IrcColourCode::RED . " N "
292
-            . IrcColourCode::DARK_BLUE . $this->baseUrl . "/internal.php/viewRequest?id={$request->getId()} "
293
-            . IrcColourCode::DARK_RED . "* "
294
-            . IrcColourCode::DARK_GREEN . $request->getName()
295
-            . IrcColourCode::DARK_RED . " * "
287
+            IrcColourCode::DARK_GREY."[["
288
+            . IrcColourCode::DARK_GREEN."acc:"
289
+            . IrcColourCode::ORANGE.$request->getId()
290
+            . IrcColourCode::DARK_GREY."]]"
291
+            . IrcColourCode::RED." N "
292
+            . IrcColourCode::DARK_BLUE.$this->baseUrl."/internal.php/viewRequest?id={$request->getId()} "
293
+            . IrcColourCode::DARK_RED."* "
294
+            . IrcColourCode::DARK_GREEN.$request->getName()
295
+            . IrcColourCode::DARK_RED." * "
296 296
             . IrcColourCode::RESET
297 297
         );
298 298
     }
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
     public function emailCreated(EmailTemplate $template)
454 454
     {
455 455
         $username = $this->currentUser->getUsername();
456
-        $this->send("Email {$template->getId()} ({$template->getName()}) created by " . $username);
456
+        $this->send("Email {$template->getId()} ({$template->getName()}) created by ".$username);
457 457
     }
458 458
 
459 459
     /**
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
     public function emailEdited(EmailTemplate $template)
465 465
     {
466 466
         $username = $this->currentUser->getUsername();
467
-        $this->send("Email {$template->getId()} ({$template->getName()}) edited by " . $username);
467
+        $this->send("Email {$template->getId()} ({$template->getName()}) edited by ".$username);
468 468
     }
469 469
     #endregion
470 470
 }
471 471
\ No newline at end of file
Please login to merge, or discard this patch.
includes/Helpers/HttpHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     public function get($url, $parameters = null, $headers = array())
54 54
     {
55 55
         if ($parameters !== null && is_array($parameters)) {
56
-            $getString = '?' . http_build_query($parameters);
56
+            $getString = '?'.http_build_query($parameters);
57 57
             $url .= $getString;
58 58
         }
59 59
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
         if ($result === false) {
70 70
             $error = curl_error($this->curlHandle);
71
-            throw new CurlException('Remote request failed with error ' . $error);
71
+            throw new CurlException('Remote request failed with error '.$error);
72 72
         }
73 73
 
74 74
         return $result;
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
         if ($result === false) {
100 100
             $error = curl_error($this->curlHandle);
101
-            throw new CurlException('Remote request failed with error ' . $error);
101
+            throw new CurlException('Remote request failed with error '.$error);
102 102
         }
103 103
 
104 104
         return $result;
Please login to merge, or discard this patch.