Passed
Pull Request — php8 (#278)
by
unknown
21:46 queued 17:53
created
includes/Pages/UserAuth/MultiFactor/PageMultiFactor.php 1 patch
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -91,13 +91,11 @@  discard block
 block discarded – undo
91 91
                 }
92 92
 
93 93
                 $this->redirect('multiFactor');
94
-            }
95
-            else {
94
+            } else {
96 95
                 SessionAlert::error('Error enabling YubiKey OTP - invalid credentials.');
97 96
                 $this->redirect('multiFactor');
98 97
             }
99
-        }
100
-        else {
98
+        } else {
101 99
             if ($otpCredentialProvider->userIsEnrolled($currentUser->getId())) {
102 100
                 // user is not enrolled, we shouldn't have got here.
103 101
                 throw new ApplicationLogicException('User is already enrolled in the selected MFA mechanism');
@@ -161,8 +159,7 @@  discard block
 block discarded – undo
161 159
                     $this->setTemplate('mfa/enableTotpEnroll.tpl');
162 160
 
163 161
                     return;
164
-                }
165
-                else {
162
+                } else {
166 163
                     SessionAlert::error('Error enabling TOTP - invalid credentials.');
167 164
                     $this->redirect('multiFactor');
168 165
 
@@ -187,8 +184,7 @@  discard block
 block discarded – undo
187 184
                             $this->setTemplate('mfa/regenScratchTokens.tpl');
188 185
                             return;
189 186
                         }
190
-                    }
191
-                    else {
187
+                    } else {
192 188
                         $otpCredentialProvider->deleteCredential($currentUser);
193 189
                         SessionAlert::error('Error enabling TOTP: invalid token provided');
194 190
                     }
@@ -196,8 +192,7 @@  discard block
 block discarded – undo
196 192
 
197 193
                     $this->redirect('multiFactor');
198 194
                     return;
199
-                }
200
-                else {
195
+                } else {
201 196
                     SessionAlert::error('Error enabling TOTP - no enrollment found or enrollment expired.');
202 197
                     $this->redirect('multiFactor');
203 198
 
@@ -207,8 +202,7 @@  discard block
 block discarded – undo
207 202
 
208 203
             // urgh, dunno what happened, but it's not something expected.
209 204
             throw new ApplicationLogicException();
210
-        }
211
-        else {
205
+        } else {
212 206
             if ($otpCredentialProvider->userIsEnrolled($currentUser->getId())) {
213 207
                 // user is not enrolled, we shouldn't have got here.
214 208
                 throw new ApplicationLogicException('User is already enrolled in the selected MFA mechanism');
@@ -258,13 +252,11 @@  discard block
 block discarded – undo
258 252
                 $tokens = $otpCredentialProvider->getTokens();
259 253
                 $this->assign('tokens', $tokens);
260 254
                 $this->setTemplate('mfa/regenScratchTokens.tpl');
261
-            }
262
-            else {
255
+            } else {
263 256
                 SessionAlert::error('Error refreshing scratch tokens - invalid credentials.');
264 257
                 $this->redirect('multiFactor');
265 258
             }
266
-        }
267
-        else {
259
+        } else {
268 260
             $this->assignCSRFToken();
269 261
 
270 262
             $this->assign('alertmessage', 'To regenerate your emergency scratch tokens, please prove you are who you say you are by providing your tool password below. Note that continuing will invalidate all remaining scratch tokens, and provide a set of new ones.');
@@ -302,13 +294,11 @@  discard block
 block discarded – undo
302 294
                 $otpCredentialProvider->deleteCredential($currentUser);
303 295
                 SessionAlert::success('Disabled ' . $factorType . '.');
304 296
                 $this->redirect('multiFactor');
305
-            }
306
-            else {
297
+            } else {
307 298
                 SessionAlert::error('Error disabling ' . $factorType . ' - invalid credentials.');
308 299
                 $this->redirect('multiFactor');
309 300
             }
310
-        }
311
-        else {
301
+        } else {
312 302
             if (!$otpCredentialProvider->userIsEnrolled($currentUser->getId())) {
313 303
                 // user is not enrolled, we shouldn't have got here.
314 304
                 throw new ApplicationLogicException('User is not enrolled in the selected MFA mechanism');
Please login to merge, or discard this patch.
includes/Pages/RequestAction/PageBreakReservation.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,13 +33,11 @@  discard block
 block discarded – undo
33 33
 
34 34
         if ($currentUser->getId() === $request->getReserved()) {
35 35
             $this->doUnreserve($request, $database);
36
-        }
37
-        else {
36
+        } else {
38 37
             // not the same user!
39 38
             if ($this->barrierTest('force', $currentUser)) {
40 39
                 $this->doBreakReserve($request, $database);
41
-            }
42
-            else {
40
+            } else {
43 41
                 throw new AccessDeniedException($this->getSecurityManager(), $this->getDomainAccessManager());
44 42
             }
45 43
         }
@@ -83,8 +81,7 @@  discard block
 block discarded – undo
83 81
             $this->skipAlerts();
84 82
 
85 83
             $this->setTemplate("confirmations/breakreserve.tpl");
86
-        }
87
-        else {
84
+        } else {
88 85
             $request->setReserved(null);
89 86
             $request->setUpdateVersion(WebRequest::postInt('updateversion'));
90 87
             $request->save();
Please login to merge, or discard this patch.
includes/Pages/RequestAction/PageCustomClose.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@  discard block
 block discarded – undo
54 54
             if ($success) {
55 55
                 $this->redirect();
56 56
             }
57
-        }
58
-        else {
57
+        } else {
59 58
             $this->assignCSRFToken();
60 59
             $this->showCustomCloseForm($database, $request);
61 60
         }
@@ -311,8 +310,7 @@  discard block
 block discarded – undo
311 310
         if ($action == EmailTemplate::ACTION_CREATED) {
312 311
             $logCloseType = 'custom-y';
313 312
             $notificationCloseType = "Custom, Created";
314
-        }
315
-        else {
313
+        } else {
316 314
             $logCloseType = 'custom-n';
317 315
             $notificationCloseType = "Custom, Not Created";
318 316
         }
Please login to merge, or discard this patch.
includes/Pages/PageDomainManagement.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -83,8 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
             Logger::domainCreated($database, $domain);
85 85
             $this->redirect('domainManagement');
86
-        }
87
-        else {
86
+        } else {
88 87
             $this->assignCSRFToken();
89 88
 
90 89
             $this->assign('shortName', '');
@@ -129,8 +128,7 @@  discard block
 block discarded – undo
129 128
                 && $template->getPreloadOnly() === false
130 129
                 && $template->getDefaultAction() === EmailTemplate::ACTION_CREATED) {
131 130
                 $domain->setDefaultClose(WebRequest::postInt('defaultClose'));
132
-            }
133
-            else {
131
+            } else {
134 132
                 SessionAlert::warning("Chosen email template is not valid for use as the default creation template");
135 133
             }
136 134
 
@@ -146,8 +144,7 @@  discard block
 block discarded – undo
146 144
 
147 145
             Logger::domainEdited($database, $domain);
148 146
             $this->redirect('domainManagement');
149
-        }
150
-        else {
147
+        } else {
151 148
             $this->assignCSRFToken();
152 149
 
153 150
             $templates = EmailTemplate::getActiveNonpreloadTemplates(
Please login to merge, or discard this patch.
includes/Pages/PageSearch.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -111,8 +111,7 @@
 block discarded – undo
111 111
             list($defaultSort, $defaultSortDirection) = WebRequest::requestListDefaultSort();
112 112
             $this->assign('defaultSort', $defaultSort);
113 113
             $this->assign('defaultSortDirection', $defaultSortDirection);
114
-        }
115
-        else {
114
+        } else {
116 115
             $this->assign('type', 'name');
117 116
             $this->assign('hasResultset', false);
118 117
             $this->assign('limit', 50);
Please login to merge, or discard this patch.
includes/Pages/PageEmailManagement.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -117,8 +117,7 @@  discard block
 block discarded – undo
117 117
             SessionAlert::success("Email template has been saved successfully.");
118 118
 
119 119
             $this->redirect('emailManagement');
120
-        }
121
-        else {
120
+        } else {
122 121
             $this->assignCSRFToken();
123 122
             $this->assign('id', $template->getId());
124 123
             $this->assign('emailTemplate', $template);
@@ -158,8 +157,7 @@  discard block
 block discarded – undo
158 157
             $template->setDefaultAction(EmailTemplate::ACTION_CREATED);
159 158
             $template->setActive(true);
160 159
             $template->setPreloadOnly(false);
161
-        }
162
-        else {
160
+        } else {
163 161
             $defaultAction = WebRequest::postString('defaultaction');
164 162
             switch ($defaultAction) {
165 163
                 case EmailTemplate::ACTION_NONE:
@@ -212,8 +210,7 @@  discard block
 block discarded – undo
212 210
             SessionAlert::success("Email template has been saved successfully.");
213 211
 
214 212
             $this->redirect('emailManagement');
215
-        }
216
-        else {
213
+        } else {
217 214
             $this->assignCSRFToken();
218 215
             $this->assign('id', -1);
219 216
             $this->assign('emailTemplate', new EmailTemplate());
Please login to merge, or discard this patch.
includes/Pages/PageQueueManagement.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -92,15 +92,13 @@  discard block
 block discarded – undo
92 92
                 $queue->save();
93 93
                 Logger::requestQueueCreated($database, $queue);
94 94
                 $this->redirect('queueManagement');
95
-            }
96
-            else {
95
+            } else {
97 96
                 $this->populateFromObject($queue);
98 97
 
99 98
                 $this->assign('createMode', true);
100 99
                 $this->setTemplate('queue-management/edit.tpl');
101 100
             }
102
-        }
103
-        else {
101
+        } else {
104 102
             $this->assign('header', null);
105 103
             $this->assign('displayName', null);
106 104
             $this->assign('apiName', null);
@@ -167,15 +165,13 @@  discard block
 block discarded – undo
167 165
                 Logger::requestQueueEdited($database, $queue);
168 166
                 $queue->save();
169 167
                 $this->redirect('queueManagement');
170
-            }
171
-            else {
168
+            } else {
172 169
                 $this->populateFromObject($queue);
173 170
 
174 171
                 $this->assign('createMode', false);
175 172
                 $this->setTemplate('queue-management/edit.tpl');
176 173
             }
177
-        }
178
-        else {
174
+        } else {
179 175
             $this->populateFromObject($queue);
180 176
 
181 177
             $this->assign('createMode', false);
Please login to merge, or discard this patch.
includes/Pages/Registration/PageRegisterBase.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@  discard block
 block discarded – undo
55 55
                 $this->setTemplate($this->getRegistrationTemplate());
56 56
                 $this->addJs("/vendor/dropbox/zxcvbn/dist/zxcvbn.js");
57 57
             }
58
-        }
59
-        else {
58
+        } else {
60 59
             $domain = WebRequest::getString('d');
61 60
             if ($domain === null) {
62 61
                 throw new ApplicationLogicException("No domain specified.");
@@ -248,8 +247,7 @@  discard block
 block discarded – undo
248 247
             $authoriseUrl = $oauth->getRequestToken();
249 248
             WebRequest::setOAuthPartialLogin($user);
250 249
             $this->redirectUrl($authoriseUrl);
251
-        }
252
-        else {
250
+        } else {
253 251
             // only notify if we're not using the oauth signup.
254 252
             $this->getNotificationHelper()->userNew($user);
255 253
             WebRequest::setLoggedInUser($user);
Please login to merge, or discard this patch.
includes/Pages/PageEditComment.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -101,8 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
             SessionAlert::success('Comment has been saved successfully');
103 103
             $this->redirectBack($comment->getRequest());
104
-        }
105
-        else {
104
+        } else {
106 105
             $this->assignCSRFToken();
107 106
             $this->assign('comment', $comment);
108 107
             $this->assign('request', $request);
@@ -171,8 +170,7 @@  discard block
 block discarded – undo
171 170
 
172 171
         if ($source == 'flagged') {
173 172
             $this->redirect('flaggedComments');
174
-        }
175
-        else {
173
+        } else {
176 174
             $this->redirect('viewRequest', null, array('id' => $requestId));
177 175
         }
178 176
     }
Please login to merge, or discard this patch.