Passed
Pull Request — master (#281)
by
unknown
09:47 queued 05:51
created
includes/DataObjects/RequestQueue.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -258,12 +258,10 @@
 block discarded – undo
258 258
 
259 259
             if ($statement->execute()) {
260 260
                 $this->id = (int)$this->dbObject->lastInsertId();
261
-            }
262
-            else {
261
+            } else {
263 262
                 throw new Exception($statement->errorInfo());
264 263
             }
265
-        }
266
-        else {
264
+        } else {
267 265
             $statement = $this->dbObject->prepare(<<<SQL
268 266
                 UPDATE requestqueue SET
269 267
                     enabled = :enabled,
Please login to merge, or discard this patch.
includes/DataObjects/Domain.php 1 patch
Braces   +6 added lines, -9 removed lines patch added patch discarded remove patch
@@ -52,12 +52,10 @@  discard block
 block discarded – undo
52 52
 
53 53
                 if ($domain === false) {
54 54
                     self::$currentDomain = self::getById(1, $database); // FIXME: #594 User::getCurrent($database)->getDefaultDomain();
55
-                }
56
-                else {
55
+                } else {
57 56
                     self::$currentDomain = $domain;
58 57
                 }
59
-            }
60
-            else {
58
+            } else {
61 59
                 self::$currentDomain = self::getById(1, $database); // FIXME: #594 User::getCurrent($database)->getDefaultDomain();
62 60
             }
63 61
         }
@@ -86,7 +84,8 @@  discard block
 block discarded – undo
86 84
         return $result;
87 85
     }
88 86
 
89
-    public static function getAll(PdoDatabase $database) {
87
+    public static function getAll(PdoDatabase $database)
88
+    {
90 89
         $statement = $database->prepare("SELECT * FROM domain;");
91 90
         $statement->execute();
92 91
 
@@ -155,12 +154,10 @@  discard block
 block discarded – undo
155 154
 
156 155
             if ($statement->execute()) {
157 156
                 $this->id = (int)$this->dbObject->lastInsertId();
158
-            }
159
-            else {
157
+            } else {
160 158
                 throw new Exception($statement->errorInfo());
161 159
             }
162
-        }
163
-        else {
160
+        } else {
164 161
             $statement = $this->dbObject->prepare(<<<SQL
165 162
                 UPDATE domain SET
166 163
                     longname = :longname,
Please login to merge, or discard this patch.
includes/Tasks/PageBase.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -264,8 +264,7 @@
 block discarded – undo
264 264
         // Are we changing script?
265 265
         if ($script === null || substr($currentScriptName, -1 * count($script)) === $script) {
266 266
             $targetScriptName = $currentScriptName;
267
-        }
268
-        else {
267
+        } else {
269 268
             $targetScriptName = $this->getSiteConfiguration()->getBaseUrl() . '/' . $script;
270 269
         }
271 270
 
Please login to merge, or discard this patch.
includes/Tasks/JsonApiPageBase.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,8 +72,7 @@
 block discarded – undo
72 72
         if ($targetVar !== null && preg_match('/^[a-z]+$/', $targetVar)) {
73 73
             $data = $targetVar . ' = ' . $data . ';';
74 74
             header("Content-Type: text/javascript");
75
-        }
76
-        else {
75
+        } else {
77 76
             header("Content-Type: application/json");
78 77
         }
79 78
 
Please login to merge, or discard this patch.
includes/Tasks/PagedInternalPageBase.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@
 block discarded – undo
55 55
         if ($pageCount < $pageLimit) {
56 56
             if ($pageData['lowpage'] == 1 && $pageData['hipage'] < $pageData['maxpage']) {
57 57
                 $pageData['hipage'] = min($pageLimit, $pageData['maxpage']);
58
-            }
59
-            elseif ($pageData['lowpage'] > 1 && $pageData['hipage'] == $pageData['maxpage']) {
58
+            } elseif ($pageData['lowpage'] > 1 && $pageData['hipage'] == $pageData['maxpage']) {
60 59
                 $pageData['lowpage'] = max(1, $pageData['maxpage'] - $pageLimit + 1);
61 60
             }
62 61
         }
Please login to merge, or discard this patch.
includes/Security/CredentialProviders/CredentialProviderBase.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -115,8 +115,7 @@
 block discarded – undo
115 115
             $sql = 'UPDATE credential SET factor = factor - 1 WHERE user = :user AND factor > :factor';
116 116
             $statement = $this->database->prepare($sql);
117 117
             $statement->execute(array(':user' => $user->getId(), ':factor' => $stage));
118
-        }
119
-        else {
118
+        } else {
120 119
             // There are other auth factors at this point. Don't renumber the factors just yet.
121 120
         }
122 121
 
Please login to merge, or discard this patch.
includes/Security/SecurityManager.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -197,12 +197,10 @@
 block discarded – undo
197 197
             if ($this->roleConfiguration->roleNeedsIdentification($v)) {
198 198
                 if ($identified) {
199 199
                     $activeRoles[] = $v;
200
-                }
201
-                else {
200
+                } else {
202 201
                     $inactiveRoles[] = $v;
203 202
                 }
204
-            }
205
-            else {
203
+            } else {
206 204
                 $activeRoles[] = $v;
207 205
             }
208 206
         }
Please login to merge, or discard this patch.
includes/Pages/PageBan.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -85,8 +85,7 @@  discard block
 block discarded – undo
85 85
                 SessionAlert::error($ex->getMessage());
86 86
                 $this->redirect("bans", "set");
87 87
             }
88
-        }
89
-        else {
88
+        } else {
90 89
             $this->handleGetMethodForSetBan();
91 90
 
92 91
             $user = User::getCurrent($this->getDatabase());
@@ -134,8 +133,7 @@  discard block
 block discarded – undo
134 133
                 SessionAlert::error($ex->getMessage());
135 134
                 $this->redirect("bans", "set");
136 135
             }
137
-        }
138
-        else {
136
+        } else {
139 137
             $this->handleGetMethodForSetBan();
140 138
 
141 139
             $user = User::getCurrent($database);
@@ -262,8 +260,7 @@  discard block
 block discarded – undo
262 260
             $this->getNotificationHelper()->unbanned($ban, $unbanReason);
263 261
 
264 262
             $this->redirect('bans');
265
-        }
266
-        else {
263
+        } else {
267 264
             $this->assignCSRFToken();
268 265
             $this->assign('ban', $ban);
269 266
             $this->setTemplate('bans/unban.tpl');
@@ -283,17 +280,14 @@  discard block
 block discarded – undo
283 280
 
284 281
             if (!$duration) {
285 282
                 throw new ApplicationLogicException('Invalid ban time');
286
-            }
287
-            elseif (time() > $duration) {
283
+            } elseif (time() > $duration) {
288 284
                 throw new ApplicationLogicException('Ban time has already expired!');
289 285
             }
290 286
 
291 287
             return $duration;
292
-        }
293
-        elseif ($duration === "-1") {
288
+        } elseif ($duration === "-1") {
294 289
             return null;
295
-        }
296
-        else {
290
+        } else {
297 291
             return WebRequest::postInt('duration') + time();
298 292
         }
299 293
     }
@@ -585,8 +579,7 @@  discard block
 block discarded – undo
585 579
             $ipParts = explode('/', $targetIp, 2);
586 580
             $targetIp = $ipParts[0];
587 581
             $targetMask = (int)$ipParts[1];
588
-        }
589
-        else {
582
+        } else {
590 583
             // Default the CIDR range based on the IP type
591 584
             $targetMask = filter_var($targetIp, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) ? 128 : 32;
592 585
         }
Please login to merge, or discard this patch.
includes/Helpers/IrcNotificationHelper.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -111,8 +111,7 @@  discard block
 block discarded – undo
111 111
             if ($amqpSiteConfig['tls']) {
112 112
                 $amqpConnectionConfig->setIsSecure(true);
113 113
                 $amqpConnectionConfig->setSslVerify(true);
114
-            }
115
-            else {
114
+            } else {
116 115
                 $amqpConnectionConfig->setIsSecure(false);
117 116
             }
118 117
 
@@ -268,8 +267,7 @@  discard block
 block discarded – undo
268 267
     {
269 268
         if ($ban->getDuration() === null) {
270 269
             $duration = "indefinitely";
271
-        }
272
-        else {
270
+        } else {
273 271
             $duration = "until " . date("F j, Y, g:i a", $ban->getDuration());
274 272
         }
275 273
 
@@ -277,8 +275,7 @@  discard block
 block discarded – undo
277 275
 
278 276
         if ($ban->getVisibility() == 'user') {
279 277
             $this->send("Ban {$ban->getId()} set by {$username} for '{$ban->getReason()}' {$duration}");
280
-        }
281
-        else {
278
+        } else {
282 279
             $this->send("Ban {$ban->getId()} set by {$username} {$duration}");
283 280
         }
284 281
     }
Please login to merge, or discard this patch.