Passed
Push — master ( c13250...aa6318 )
by Tomasz
03:33
created
web/lib/admin/domain/SilverbulletUser.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         $tokenExpiry = date('Y-m-d H:i:s', strtotime($date));
103 103
         if($tokenExpiry > $this->defaultUserExpiry){
104 104
             $this->set(self::EXPIRY, $tokenExpiry);
105
-        }else{
105
+        } else{
106 106
             $this->clear();
107 107
         }
108 108
     }
@@ -124,9 +124,9 @@  discard block
 block discarded – undo
124 124
         $days = $this->getAcknowledgeDays();
125 125
         if($days <= $max * 0.2 && $days > $max * 0.1){
126 126
             return self::LEVEL_YELLOW;
127
-        }elseif ($days <= $max * 0.1){
127
+        } elseif ($days <= $max * 0.1){
128 128
             return self::LEVEL_RED;
129
-        }else{
129
+        } else{
130 130
             return self::LEVEL_GREEN;
131 131
         }
132 132
     }
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
             foreach ($this->certificates as $certificate) {
213 213
                 $certificate->revoke($profile);
214 214
             }
215
-        }else{
215
+        } else{
216 216
             $this->set(self::DEACTIVATION_TIME, '0000-00-00 00:00:00');
217 217
         }
218 218
     }
Please login to merge, or discard this patch.
web/lib/admin/view/MessageBox.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
     public function __toString(){
64 64
         if($this->hasMessages()){
65 65
             return $this->box->__toString();
66
-        }else{
66
+        } else{
67 67
             return '';
68 68
         }
69 69
     }
Please login to merge, or discard this patch.
web/diag/action_userdiag.php 1 patch
Braces   +18 added lines, -12 removed lines patch added patch discarded remove patch
@@ -134,8 +134,9 @@  discard block
 block discarded – undo
134 134
                     array_multisort($name, SORT_ASC, SORT_LOCALE_STRING, $displaylist);
135 135
                     setlocale(LC_ALL, $current_locale);
136 136
 
137
-                    foreach ($displaylist as $id => $oneinst)
138
-                        echo "<option id='" . $id . "' value='" . $oneinst['realmlist'] . "'>" . $oneinst['name'] . "</option>";
137
+                    foreach ($displaylist as $id => $oneinst) {
138
+                                            echo "<option id='" . $id . "' value='" . $oneinst['realmlist'] . "'>" . $oneinst['name'] . "</option>";
139
+                    }
139 140
                     ?>
140 141
                 </select>
141 142
                 <button type='submit' class='submit'><?php echo _("Submit Information"); ?></button>
@@ -197,10 +198,12 @@  discard block
 block discarded – undo
197 198
                 $checkresult[$number] = $check['instance']->UDP_reachability($number, FALSE, FALSE);
198 199
                 if ($checkresult[$number] == \core\diag\RADIUSTests::RETVAL_CONVERSATION_REJECT) { // so now things work?!
199 200
                     // either a packet size or Operator-Name problem!
200
-                    if ($check['instance']->UDP_reachability($number, TRUE, FALSE) != \core\diag\RADIUSTests::RETVAL_CONVERSATION_REJECT)
201
-                        $realmproblems[] = ["REALM" => $check['realm'], "STATUS" => "OPERATOR-NAME", "FROM" => $probe['display_name'], "DETAIL" => ""];
202
-                    if ($check['instance']->UDP_reachability($number, FALSE, TRUE) != \core\diag\RADIUSTests::RETVAL_CONVERSATION_REJECT)
203
-                        $realmproblems[] = ["REALM" => $check['realm'], "STATUS" => "PACKETSIZE", "FROM" => $probe['display_name'], "DETAIL" => ""];
201
+                    if ($check['instance']->UDP_reachability($number, TRUE, FALSE) != \core\diag\RADIUSTests::RETVAL_CONVERSATION_REJECT) {
202
+                                            $realmproblems[] = ["REALM" => $check['realm'], "STATUS" => "OPERATOR-NAME", "FROM" => $probe['display_name'], "DETAIL" => ""];
203
+                    }
204
+                    if ($check['instance']->UDP_reachability($number, FALSE, TRUE) != \core\diag\RADIUSTests::RETVAL_CONVERSATION_REJECT) {
205
+                                            $realmproblems[] = ["REALM" => $check['realm'], "STATUS" => "PACKETSIZE", "FROM" => $probe['display_name'], "DETAIL" => ""];
206
+                    }
204 207
                 } else { // still no response or immediate reject
205 208
                     // if this is a CAT realm with anon ID set, we can't be seeing an NPS ignorance problem
206 209
                     // and consequently, the realm has actual issues
@@ -234,12 +237,13 @@  discard block
 block discarded – undo
234 237
 // re-write check history with that extra knowledge
235 238
     $copycat = $realmproblems;
236 239
 
237
-    foreach ($realmproblems as &$problem)
238
-        if ($problem['STATUS'] == "REALM_POSSIBLY_NPS")
240
+    foreach ($realmproblems as &$problem) {
241
+            if ($problem['STATUS'] == "REALM_POSSIBLY_NPS")
239 242
             foreach ($copycat as $otherproblem)
240 243
                 if ($problem['REALM'] == $otherproblem['REALM'] && $problem['FROM'] != $otherproblem['FROM'] && $otherproblem['STATUS'] != "REALM_POSSIBLY_NPS")
241 244
                     if ($otherproblem['STATUS'] == "REACHABLE") { // worked elsewhere, but not on this probe:
242 245
                         $problem['STATUS'] = "REALM_DOWN";
246
+    }
243 247
                     } else { // inherit other problem; in any case not an NPS problem
244 248
                         $problem['STATUS'] = $otherproblem['STATUS'];
245 249
                     }
@@ -249,11 +253,12 @@  discard block
 block discarded – undo
249 253
 
250 254
     $copycat = $realmproblems;
251 255
 
252
-    foreach ($realmproblems as &$problem)
253
-        if ($problem['STATUS'] == "REALM_DOWN")
256
+    foreach ($realmproblems as &$problem) {
257
+            if ($problem['STATUS'] == "REALM_DOWN")
254 258
             foreach ($copycat as $otherproblem)
255 259
                 if ($problem['REALM'] == $otherproblem['REALM'] && $problem['FROM'] != $otherproblem['FROM'] && $otherproblem['STATUS'] == "REACHABLE")
256 260
                     $problem['STATUS'] = "INFRASTRUCTURE";
261
+    }
257 262
     unset($problem);
258 263
 
259 264
 // finally, extract all certprobs we got from the reachability checks; merge from all
@@ -264,8 +269,9 @@  discard block
 block discarded – undo
264 269
     foreach ($checks as $check) {
265 270
         $instance = $check['instance'];
266 271
         $resultset = $instance->UDP_reachability_result;
267
-        foreach ($resultset as $result)
268
-            $all_certprobs = array_merge($all_certprobs, $result['cert_oddities']);
272
+        foreach ($resultset as $result) {
273
+                    $all_certprobs = array_merge($all_certprobs, $result['cert_oddities']);
274
+        }
269 275
     }
270 276
 
271 277
 // now we have something to say...
Please login to merge, or discard this patch.
web/lib/admin/PageDecoration.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -206,8 +206,7 @@
 block discarded – undo
206 206
             $cutoffPosition = strrpos($_SERVER['PHP_SELF'], "accountstatus/");
207 207
         } elseif (strrpos($_SERVER['PHP_SELF'], "diag/")) {
208 208
             $cutoffPosition = strrpos($_SERVER['PHP_SELF'], "diag/");
209
-        }
210
-            else {
209
+        } else {
211 210
             $cutoffPosition = strrpos($_SERVER['PHP_SELF'], "/");
212 211
         }
213 212
 
Please login to merge, or discard this patch.
web/lib/admin/http/SilverbulletAjaxController.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,9 +33,9 @@
 block discarded – undo
33 33
     protected function doCreateCommand($commandToken) {
34 34
         if($commandToken == ValidateEmailAddress::COMMAND){
35 35
             return new ValidateEmailAddress($commandToken, $this->context);
36
-        }elseif($commandToken == GetTokenEmailDetails::COMMAND) {
36
+        } elseif($commandToken == GetTokenEmailDetails::COMMAND) {
37 37
             return new GetTokenEmailDetails($commandToken, $this->context);
38
-        }else {
38
+        } else {
39 39
             return new DefaultCommand($commandToken);
40 40
         }
41 41
     }
Please login to merge, or discard this patch.
web/lib/admin/http/DeleteUserCommand.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,12 +45,12 @@
 block discarded – undo
45 45
             if($confirmation=='true'){
46 46
                 $user->setDeactivated(true, $this->context->getProfile());
47 47
                 $user->save();
48
-            }else{
48
+            } else{
49 49
                 $this->storeInfoMessage("User '".$user->getUsername()."' deactivation has been canceled!");
50 50
             }
51 51
 
52 52
             $this->context->redirectAfterSubmit();
53
-        }else{
53
+        } else{
54 54
             //Append terms of use popup
55 55
             $builder = $this->context->getBuilder();
56 56
             $dialogTitle = _('Deactivate User');
Please login to merge, or discard this patch.
web/lib/admin/view/AbstractPage.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
         if(isset($this->groups [$name])){
50 50
             $group = $this->groups [$name];
51 51
             $group->addElement($element);
52
-        }else if(isset($this->blocks[$name])){
52
+        } else if(isset($this->blocks[$name])){
53 53
             $group = new PageElementGroup();
54 54
             $group->addElement($this->blocks[$name]);
55 55
             $this->blocks[$name] = $this->groups[$name] = $group;
56 56
             $group->addElement($element);
57
-        }else{
57
+        } else{
58 58
             $this->assign($name, $element);
59 59
         }
60 60
     }
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     public function fetch($name){
102 102
         if(isset($this->blocks[$name])){
103 103
             return $this->blocks[$name];
104
-        }else{
104
+        } else{
105 105
             return $this->nullElement;
106 106
         }
107 107
     }
Please login to merge, or discard this patch.
web/lib/admin/view/html/Tag.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
         $innerString = $this->composeInnerString();
41 41
         if(!empty($innerString)){
42 42
             $tagString = "\n".$this->tab."<" . $this->name . $attributeString . ">" . $innerString . "</" . $this->name . ">";
43
-        }else{
43
+        } else{
44 44
             $tagString = "\n".$this->tab."<" . $this->name . $attributeString . "></" . $this->name . ">";
45 45
         }
46 46
         return $tagString;
Please login to merge, or discard this patch.
tests/unit/web/lib/admin/http/MockPHPMailer.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
     public function send(){
20 20
         if($this->Subject && $this->Body && count($this->to)>0){
21 21
             return true;
22
-        }else{
22
+        } else{
23 23
             $this->ErrorInfo = "Missing subject, body or email address!";
24 24
             return false;
25 25
         }
Please login to merge, or discard this patch.