Test Setup Failed
Push — irc-comment-visibility-fix ( 1f25c9...574aa6 )
by Michael
10:52
created
includes/PdoDatabase.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -97,8 +97,7 @@
 block discarded – undo
97 97
         // all over the rest of the code
98 98
         if ($this->hasActiveTransaction) {
99 99
             return false;
100
-        }
101
-        else {
100
+        } else {
102 101
             $accessMode = 'READ WRITE';
103 102
 
104 103
             switch ($isolationLevel) {
Please login to merge, or discard this patch.
includes/DataObjects/Ban.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -155,12 +155,10 @@  discard block
 block discarded – undo
155 155
 
156 156
             if ($statement->execute()) {
157 157
                 $this->id = (int)$this->dbObject->lastInsertId();
158
-            }
159
-            else {
158
+            } else {
160 159
                 throw new Exception($statement->errorInfo());
161 160
             }
162
-        }
163
-        else {
161
+        } else {
164 162
             // update
165 163
             $statement = $this->dbObject->prepare(<<<SQL
166 164
 UPDATE `ban`
@@ -339,8 +337,7 @@  discard block
 block discarded – undo
339 337
     {
340 338
         if ($ip === null) {
341 339
             $this->ip = null;
342
-        }
343
-        else {
340
+        } else {
344 341
             $this->ip = inet_pton($ip);
345 342
         }
346 343
 
Please login to merge, or discard this patch.
includes/DataObjects/UserDomain.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,12 +37,10 @@
 block discarded – undo
37 37
 
38 38
             if ($statement->execute()) {
39 39
                 $this->id = (int)$this->dbObject->lastInsertId();
40
-            }
41
-            else {
40
+            } else {
42 41
                 throw new Exception($statement->errorInfo());
43 42
             }
44
-        }
45
-        else {
43
+        } else {
46 44
             // insert / delete only, no updates please.
47 45
             throw new Exception('Updating domain membership is not available');
48 46
         }
Please login to merge, or discard this patch.
includes/DataObjects/RequestForm.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -129,12 +129,10 @@
 block discarded – undo
129 129
 
130 130
             if ($statement->execute()) {
131 131
                 $this->id = (int)$this->dbObject->lastInsertId();
132
-            }
133
-            else {
132
+            } else {
134 133
                 throw new Exception($statement->errorInfo());
135 134
             }
136
-        }
137
-        else {
135
+        } else {
138 136
             $statement = $this->dbObject->prepare(<<<SQL
139 137
                 UPDATE requestform SET
140 138
                     enabled = :enabled,
Please login to merge, or discard this patch.
includes/DataObjects/EmailTemplate.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -88,11 +88,9 @@  discard block
 block discarded – undo
88 88
         if ($defaultAction === false) {
89 89
             $statement = $database->prepare(
90 90
                 "SELECT * FROM `emailtemplate` WHERE defaultaction NOT IN ('created', 'not created') AND active = 1 AND domain = :domain;");
91
-        }
92
-        elseif ($defaultAction === null) {
91
+        } elseif ($defaultAction === null) {
93 92
             $statement = $database->prepare("SELECT * FROM `emailtemplate` WHERE active = 1 AND domain = :domain;");
94
-        }
95
-        else {
93
+        } else {
96 94
             $statement = $database->prepare("SELECT * FROM `emailtemplate` WHERE defaultaction = :forcreated AND active = 1 AND domain = :domain;");
97 95
             $statement->bindValue(":forcreated", $defaultAction);
98 96
         }
@@ -195,12 +193,10 @@  discard block
 block discarded – undo
195 193
 
196 194
             if ($statement->execute()) {
197 195
                 $this->id = (int)$this->dbObject->lastInsertId();
198
-            }
199
-            else {
196
+            } else {
200 197
                 throw new Exception($statement->errorInfo());
201 198
             }
202
-        }
203
-        else {
199
+        } else {
204 200
             // update
205 201
             $statement = $this->dbObject->prepare(<<<SQL
206 202
 UPDATE `emailtemplate`
Please login to merge, or discard this patch.
includes/DataObjects/RequestData.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -79,12 +79,10 @@
 block discarded – undo
79 79
 
80 80
             if ($statement->execute()) {
81 81
                 $this->id = (int)$this->dbObject->lastInsertId();
82
-            }
83
-            else {
82
+            } else {
84 83
                 throw new Exception($statement->errorInfo());
85 84
             }
86
-        }
87
-        else {
85
+        } else {
88 86
             // update
89 87
             throw new ApplicationLogicException('Updates to RequestData are not supported.');
90 88
         }
Please login to merge, or discard this patch.
includes/DataObjects/User.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -56,12 +56,10 @@  discard block
 block discarded – undo
56 56
 
57 57
                 if ($user === false) {
58 58
                     self::$currentUser = new CommunityUser();
59
-                }
60
-                else {
59
+                } else {
61 60
                     self::$currentUser = $user;
62 61
                 }
63
-            }
64
-            else {
62
+            } else {
65 63
                 $anonymousCoward = new CommunityUser();
66 64
 
67 65
                 self::$currentUser = $anonymousCoward;
@@ -189,12 +187,10 @@  discard block
 block discarded – undo
189 187
 
190 188
             if ($statement->execute()) {
191 189
                 $this->id = (int)$this->dbObject->lastInsertId();
192
-            }
193
-            else {
190
+            } else {
194 191
                 throw new Exception($statement->errorInfo());
195 192
             }
196
-        }
197
-        else {
193
+        } else {
198 194
             // update
199 195
             $statement = $this->dbObject->prepare(<<<SQL
200 196
 				UPDATE `user` SET 
@@ -393,12 +389,10 @@  discard block
 block discarded – undo
393 389
         if ($this->forceidentified === 0 || $this->forceidentified === "0") {
394 390
             // User forced to unidentified in the database.
395 391
             return false;
396
-        }
397
-        elseif ($this->forceidentified === 1 || $this->forceidentified === "1") {
392
+        } elseif ($this->forceidentified === 1 || $this->forceidentified === "1") {
398 393
             // User forced to identified in the database.
399 394
             return true;
400
-        }
401
-        else {
395
+        } else {
402 396
             // User not forced to any particular identified status; consult IdentificationVerifier
403 397
             return $iv->isUserIdentified($this->getOnWikiName());
404 398
         }
Please login to merge, or discard this patch.
includes/DataObjects/Comment.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -108,12 +108,10 @@
 block discarded – undo
108 108
 
109 109
             if ($statement->execute()) {
110 110
                 $this->id = (int)$this->dbObject->lastInsertId();
111
-            }
112
-            else {
111
+            } else {
113 112
                 throw new Exception($statement->errorInfo());
114 113
             }
115
-        }
116
-        else {
114
+        } else {
117 115
             // update
118 116
             $statement = $this->dbObject->prepare(<<<SQL
119 117
 UPDATE comment
Please login to merge, or discard this patch.
includes/DataObjects/UserPreference.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,8 @@  discard block
 block discarded – undo
28 28
     /** @var ?mixed */
29 29
     private $value;
30 30
 
31
-    public static function getLocalPreference(PdoDatabase $database, int $user, string $preference, int $domain) {
31
+    public static function getLocalPreference(PdoDatabase $database, int $user, string $preference, int $domain)
32
+    {
32 33
         $statement = $database->prepare('SELECT * FROM userpreference WHERE preference = :preference AND USER = :user AND domain = :domain');
33 34
         $statement->execute([
34 35
             ':user' => $user,
@@ -45,7 +46,8 @@  discard block
 block discarded – undo
45 46
         return $resultObject;
46 47
     }
47 48
 
48
-    public static function getGlobalPreference(PdoDatabase $database, int $user, string $preference) {
49
+    public static function getGlobalPreference(PdoDatabase $database, int $user, string $preference)
50
+    {
49 51
         $statement = $database->prepare('SELECT * FROM userpreference WHERE preference = :preference AND USER = :user AND domain IS NULL');
50 52
         $statement->execute([
51 53
             ':user' => $user,
@@ -84,11 +86,10 @@  discard block
 block discarded – undo
84 86
 
85 87
             if ($statement->execute()) {
86 88
                 $this->id = (int)$this->dbObject->lastInsertId();
87
-            }
88
-            else {
89
+            } else {
89 90
                 throw new Exception($statement->errorInfo());
90 91
             }
91
-        }else{
92
+        } else {
92 93
             // update
93 94
             $statement = $this->dbObject->prepare(<<<SQL
94 95
                 UPDATE `userpreference` SET 
Please login to merge, or discard this patch.