Test Failed
Branch silverbullet (05f8b4)
by Brook
05:51
created
web/diag/action_userdiag.php 1 patch
Braces   +23 added lines, -16 removed lines patch added patch discarded remove patch
@@ -67,10 +67,11 @@  discard block
 block discarded – undo
67 67
 
68 68
 function mainpage_url() {
69 69
     $main_url = valid_host($_SERVER['HTTP_HOST']);
70
-    if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on")
71
-        $main_url = "https://" . $main_url;
72
-    else
73
-        $main_url = "http://" . $main_url;
70
+    if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") {
71
+            $main_url = "https://" . $main_url;
72
+    } else {
73
+            $main_url = "http://" . $main_url;
74
+    }
74 75
     $main_url .= substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], "/diag/"));
75 76
     return $main_url;
76 77
 }
@@ -135,8 +136,9 @@  discard block
 block discarded – undo
135 136
                     array_multisort($name, SORT_ASC, SORT_LOCALE_STRING, $displaylist);
136 137
                     setlocale(LC_ALL, $current_locale);
137 138
 
138
-                    foreach ($displaylist as $id => $oneinst)
139
-                        echo "<option id='" . $id . "' value='" . $oneinst['realmlist'] . "'>" . $oneinst['name'] . "</option>";
139
+                    foreach ($displaylist as $id => $oneinst) {
140
+                                            echo "<option id='" . $id . "' value='" . $oneinst['realmlist'] . "'>" . $oneinst['name'] . "</option>";
141
+                    }
140 142
                     ?>
141 143
                 </select>
142 144
                 <button type='submit' class='submit'><?php echo _("Submit Information"); ?></button>
@@ -197,10 +199,12 @@  discard block
 block discarded – undo
197 199
                 $checkresult[$number] = $check['instance']->UDP_reachability($number, FALSE, FALSE);
198 200
                 if ($checkresult[$number] == RETVAL_CONVERSATION_REJECT) { // so now things work?!
199 201
                     // either a packet size or Operator-Name problem!
200
-                    if ($check['instance']->UDP_reachability($number, TRUE, FALSE) != 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) != RETVAL_CONVERSATION_REJECT)
203
-                        $realmproblems[] = ["REALM" => $check['realm'], "STATUS" => "PACKETSIZE", "FROM" => $probe['display_name'], "DETAIL" => ""];
202
+                    if ($check['instance']->UDP_reachability($number, TRUE, FALSE) != RETVAL_CONVERSATION_REJECT) {
203
+                                            $realmproblems[] = ["REALM" => $check['realm'], "STATUS" => "OPERATOR-NAME", "FROM" => $probe['display_name'], "DETAIL" => ""];
204
+                    }
205
+                    if ($check['instance']->UDP_reachability($number, FALSE, TRUE) != RETVAL_CONVERSATION_REJECT) {
206
+                                            $realmproblems[] = ["REALM" => $check['realm'], "STATUS" => "PACKETSIZE", "FROM" => $probe['display_name'], "DETAIL" => ""];
207
+                    }
204 208
                 } else { // still no response or immediate reject
205 209
                     // if this is a CAT realm with anon ID set, we can't be seeing an NPS ignorance problem
206 210
                     // and consequently, the realm has actual issues
@@ -234,12 +238,13 @@  discard block
 block discarded – undo
234 238
 // re-write check history with that extra knowledge
235 239
     $copycat = $realmproblems;
236 240
 
237
-    foreach ($realmproblems as &$problem)
238
-        if ($problem['STATUS'] == "REALM_POSSIBLY_NPS")
241
+    foreach ($realmproblems as &$problem) {
242
+            if ($problem['STATUS'] == "REALM_POSSIBLY_NPS")
239 243
             foreach ($copycat as $otherproblem)
240 244
                 if ($problem['REALM'] == $otherproblem['REALM'] && $problem['FROM'] != $otherproblem['FROM'] && $otherproblem['STATUS'] != "REALM_POSSIBLY_NPS")
241 245
                     if ($otherproblem['STATUS'] == "REACHABLE") { // worked elsewhere, but not on this probe:
242 246
                         $problem['STATUS'] = "REALM_DOWN";
247
+    }
243 248
                     } else { // inherit other problem; in any case not an NPS problem
244 249
                         $problem['STATUS'] = $otherproblem['STATUS'];
245 250
                     }
@@ -249,11 +254,12 @@  discard block
 block discarded – undo
249 254
 
250 255
     $copycat = $realmproblems;
251 256
 
252
-    foreach ($realmproblems as &$problem)
253
-        if ($problem['STATUS'] == "REALM_DOWN")
257
+    foreach ($realmproblems as &$problem) {
258
+            if ($problem['STATUS'] == "REALM_DOWN")
254 259
             foreach ($copycat as $otherproblem)
255 260
                 if ($problem['REALM'] == $otherproblem['REALM'] && $problem['FROM'] != $otherproblem['FROM'] && $otherproblem['STATUS'] == "REACHABLE")
256 261
                     $problem['STATUS'] = "INFRASTRUCTURE";
262
+    }
257 263
     unset($problem);
258 264
 
259 265
 // finally, extract all certprobs we got from the reachability checks; merge from all
@@ -264,8 +270,9 @@  discard block
 block discarded – undo
264 270
     foreach ($checks as $check) {
265 271
         $instance = $check['instance'];
266 272
         $resultset = $instance->UDP_reachability_result;
267
-        foreach ($resultset as $result)
268
-            $all_certprobs = array_merge($all_certprobs, $result['cert_oddities']);
273
+        foreach ($resultset as $result) {
274
+                    $all_certprobs = array_merge($all_certprobs, $result['cert_oddities']);
275
+        }
269 276
     }
270 277
     echo "<pre>";
271 278
     print_r($realmproblems);
Please login to merge, or discard this patch.
web/admin/action_fedcheck.php 1 patch
Braces   +26 added lines, -17 removed lines patch added patch discarded remove patch
@@ -44,10 +44,11 @@  discard block
 block discarded – undo
44 44
     // NAPTR existence check
45 45
     $tabletext .= "<td>";
46 46
     $naptr = $testsuite->NAPTR();
47
-    if ($naptr != RETVAL_NOTCONFIGURED)
48
-        switch ($naptr) {
47
+    if ($naptr != RETVAL_NOTCONFIGURED) {
48
+            switch ($naptr) {
49 49
             case RETVAL_NONAPTR:
50 50
                 $tabletext .= _("No NAPTR records");
51
+    }
51 52
                 break;
52 53
             case RETVAL_ONLYUNRELATEDNAPTR:
53 54
                 $tabletext .= sprintf(_("No associated NAPTR records"));
@@ -73,8 +74,9 @@  discard block
 block discarded – undo
73 74
                 }
74 75
                 if ($srv > 0) {
75 76
                     $hosts = $testsuite->NAPTR_hostnames();
76
-                    if ($hosts == RETVAL_INVALID)
77
-                        $NAPTR_issues = true;
77
+                    if ($hosts == RETVAL_INVALID) {
78
+                                            $NAPTR_issues = true;
79
+                    }
78 80
                 }
79 81
                 break;
80 82
         }
@@ -91,14 +93,17 @@  discard block
 block discarded – undo
91 93
     foreach (Config::$RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
92 94
         $testsuite->UDP_reachability($hostindex, true, true);
93 95
         $results = $testsuite->UDP_reachability_result[$hostindex];
94
-        if ($results['packetflow_sane'] != TRUE)
95
-            $UDPErrors = true;
96
-        if (empty($results['packetflow'][11]))
97
-            $UDPErrors = true;
96
+        if ($results['packetflow_sane'] != TRUE) {
97
+                    $UDPErrors = true;
98
+        }
99
+        if (empty($results['packetflow'][11])) {
100
+                    $UDPErrors = true;
101
+        }
98 102
         if (count($results['cert_oddities']) > 0) {
99
-            foreach ($results['cert_oddities'] as $oddity)
100
-                if ($oddity['level'] > $certBiggestOddity)
103
+            foreach ($results['cert_oddities'] as $oddity) {
104
+                            if ($oddity['level'] > $certBiggestOddity)
101 105
                     $certBiggestOddity = $oddity['level'];
106
+            }
102 107
         }
103 108
     }
104 109
 
@@ -119,8 +124,9 @@  discard block
 block discarded – undo
119 124
     if ($naptr > 0 && count($testsuite->NAPTR_hostname_records) > 0) {
120 125
         foreach ($testsuite->NAPTR_hostname_records as $hostindex => $addr) {
121 126
             $retval = $testsuite->TLS_clients_side_check($addr);
122
-            if ($retval != RETVAL_OK && $retval != RETVAL_SKIPPED)
123
-                $dynamicErrors = true;
127
+            if ($retval != RETVAL_OK && $retval != RETVAL_SKIPPED) {
128
+                            $dynamicErrors = true;
129
+            }
124 130
         }
125 131
     }
126 132
     if (!$dynamicErrors) {
@@ -162,10 +168,11 @@  discard block
 block discarded – undo
162 168
 $profiles_showtime = [];
163 169
 $profiles_readyconf = [];
164 170
 
165
-foreach ($allIDPs as $index => $oneidp)
171
+foreach ($allIDPs as $index => $oneidp) {
166 172
     foreach ($oneidp['instance']->listProfiles() as $profile)
167 173
         if ($profile->isShowtime()) {
168 174
             $profiles_showtime[] = ['idp' => $oneidp['instance'], 'profile' => $profile];
175
+}
169 176
         } else if ($profile->readyForShowtime()) {
170 177
             $profiles_confready[] = ['idp' => $oneidp['instance'], 'profile' => $profile];
171 178
         }
@@ -173,16 +180,18 @@  discard block
 block discarded – undo
173 180
 if (count($profiles_showtime) > 0) {
174 181
     echo "<h2>" . _("Profiles marked as visible (V)") . "</h2>" . "<table>";
175 182
     echo rowdescription();
176
-    foreach ($profiles_showtime as $oneprofile)
177
-        echo profilechecks($oneprofile['idp'], $oneprofile['profile']);
183
+    foreach ($profiles_showtime as $oneprofile) {
184
+            echo profilechecks($oneprofile['idp'], $oneprofile['profile']);
185
+    }
178 186
     echo "</table>";
179 187
 }
180 188
 
181 189
 if (count($profiles_confready) > 0) {
182 190
     echo "<h2>" . _("Profiles with sufficient configuration, not marked as visible (C)") . "</h2>" . "<table>";
183 191
     echo rowdescription();
184
-    foreach ($profiles_confready as $oneprofile)
185
-        echo profilechecks($oneprofile['idp'], $oneprofile['profile']);
192
+    foreach ($profiles_confready as $oneprofile) {
193
+            echo profilechecks($oneprofile['idp'], $oneprofile['profile']);
194
+    }
186 195
     echo "</table>";
187 196
 }
188 197
 ?>
Please login to merge, or discard this patch.
web/admin/lib/view/DefaultPage.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     public function append($name, $value){
31 31
         if(isset($this->blocks [$name])){
32 32
             $this->blocks [$name] .= "\n".$value;
33
-        }else{
33
+        } else{
34 34
             $this->assign($name, $value);
35 35
         }
36 36
     }
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     public function fetch($name){
43 43
         if(isset($this->blocks[$name])){
44 44
             return $this->blocks[$name];
45
-        }else{
45
+        } else{
46 46
             return '';
47 47
         }
48 48
     }
Please login to merge, or discard this patch.
web/admin/lib/view/html/Attribute.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
     public function __toString(){
36 36
         if(!empty($this->name) && !empty($this->value)){
37 37
             return ' ' . $this->name . '="' . $this->value . '"';
38
-        }else{
38
+        } else{
39 39
             return '';
40 40
         }
41 41
     }
Please login to merge, or discard this patch.
tests/unit/lib/view/InstitutionPageBuilderTest.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 function valid_IdP($input, $owner){
9 9
     if ($input == 1){
10 10
         return new MockInstitution();
11
-    }else{
11
+    } else{
12 12
         throw new Exception('IdP '.$input.' not found in database!');
13 13
     }
14 14
 }
Please login to merge, or discard this patch.
web/admin/lib/view/html/UnaryTag.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
     public function __toString(){
36 36
         if(!empty($this->name) && !empty($this->value)){
37 37
             return ' ' . $this->name . '="' . $this->value . '"';
38
-        }else{
38
+        } else{
39 39
             return '';
40 40
         }
41 41
     }
Please login to merge, or discard this patch.
web/admin/lib/view/html/Row.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
     public function __toString(){
36 36
         if(!empty($this->name) && !empty($this->value)){
37 37
             return ' ' . $this->name . '="' . $this->value . '"';
38
-        }else{
38
+        } else{
39 39
             return '';
40 40
         }
41 41
     }
Please login to merge, or discard this patch.
web/admin/lib/view/html/Tag.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
     public function __toString(){
36 36
         if(!empty($this->name) && !empty($this->value)){
37 37
             return ' ' . $this->name . '="' . $this->value . '"';
38
-        }else{
38
+        } else{
39 39
             return '';
40 40
         }
41 41
     }
Please login to merge, or discard this patch.
web/admin/lib/domain/PersistentEntity.php 1 patch
Braces   +13 added lines, -7 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             $query = "";
99 99
             if(isset($this->row[self::ID])){
100 100
                 $query = $this->updateQuery();
101
-            }else{
101
+            } else{
102 102
                 $query = $this->insertQuery();
103 103
             }
104 104
             if(!empty($query)){
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
                 $this->set(self::ID, $this->databaseHandle->lastID());
109 109
             }
110 110
             return $result;
111
-        }else{
111
+        } else{
112 112
             return false;
113 113
         }
114 114
     }
@@ -122,8 +122,12 @@  discard block
 block discarded – undo
122 122
         $keyString = "(";
123 123
         $valueString = "(";
124 124
         foreach ($this->row as $key => $value) {
125
-            if($keyString != "(") $keyString .= " ,";
126
-            if($valueString != "(") $valueString .= " ,";
125
+            if($keyString != "(") {
126
+                $keyString .= " ,";
127
+            }
128
+            if($valueString != "(") {
129
+                $valueString .= " ,";
130
+            }
127 131
             $keyString .= "`" . $key . "`";
128 132
             $valueString .= "'" . $value . "'";
129 133
         }
@@ -132,7 +136,7 @@  discard block
 block discarded – undo
132 136
         if($keyString != "()"){
133 137
             $query .= " " .$keyString . " VALUES " . $valueString;
134 138
             return $query;
135
-        }else{
139
+        } else{
136 140
             return "";
137 141
         }
138 142
     }
@@ -145,13 +149,15 @@  discard block
 block discarded – undo
145 149
         $query = "UPDATE `".$this->table."`";
146 150
         $updateString = "";
147 151
         foreach ($this->row as $key => $value) {
148
-            if(!empty($updateString)) $updateString .= " ,";
152
+            if(!empty($updateString)) {
153
+                $updateString .= " ,";
154
+            }
149 155
             $updateString .= "`" . $key . "`='" . $value . "'";
150 156
         }
151 157
         if(!empty($updateString)){
152 158
             $query .= " " .$updateString . " WHERE `" .self::ID. "`='".$this->get(self::ID)."'";
153 159
             return $query;
154
-        }else{
160
+        } else{
155 161
             return "";
156 162
         }
157 163
     }
Please login to merge, or discard this patch.