Passed
Pull Request — master (#281)
by
unknown
09:47 queued 05:51
created
includes/Fragments/NavigationMenuAccessControl.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,8 @@
 block discarded – undo
113 113
      *
114 114
      * @return void
115 115
      */
116
-    public function setUpNavBarBadges(User $currentUser, PdoDatabase $database) {
116
+    public function setUpNavBarBadges(User $currentUser, PdoDatabase $database)
117
+    {
117 118
         // Set up some variables.
118 119
         // A size of 0 causes nothing to show up on the page (checked on navigation-menu.tpl) so leaving it 0 here is fine.
119 120
         $countOfFlagged = 0;
Please login to merge, or discard this patch.
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/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.