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.
core/DBConnection.php 1 patch
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -83,6 +83,7 @@
 block discarded – undo
83 83
     /**
84 84
      * executes a query and triggers logging to the SQL audit log if it's not a SELECT
85 85
      * @param string $querystring the query to be executed
86
+     * @param string $database
86 87
      * @return mixed the query result as mysqli_result object; or TRUE on non-return-value statements
87 88
      */
88 89
     public static function exec($database, $querystring) {
Please login to merge, or discard this patch.
core/AbstractProfile.php 1 patch
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -236,6 +236,8 @@
 block discarded – undo
236 236
      * 
237 237
      * @param string device the device identifier string
238 238
      * @param string path the path where the new installer can be found
239
+     * @param string $device
240
+     * @param string $path
239 241
      */
240 242
     abstract public function updateCache($device, $path, $mime);
241 243
 
Please login to merge, or discard this patch.
web/admin/lib/autoloader/Psr4Autoloader.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      * Loads the class file for a given class name.
102 102
      *
103 103
      * @param string $class The fully-qualified class name.
104
-     * @return mixed The mapped file name on success, or boolean false on
104
+     * @return string|false The mapped file name on success, or boolean false on
105 105
      * failure.
106 106
      */
107 107
     public function loadClass($class)
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      *
140 140
      * @param string $prefix The namespace prefix.
141 141
      * @param string $relative_class The relative class name.
142
-     * @return mixed Boolean false if no mapped file can be loaded, or the
142
+     * @return false|string Boolean false if no mapped file can be loaded, or the
143 143
      * name of the mapped file that was loaded.
144 144
      */
145 145
     protected function loadMappedFile($prefix, $relative_class)
Please login to merge, or discard this patch.
web/admin/lib/view/html/Table.php 1 patch
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     
30 30
     /**
31 31
      * 
32
-     * @return number
32
+     * @return integer
33 33
      */
34 34
     public function size(){
35 35
         return count($this->rows);
@@ -53,7 +53,6 @@  discard block
 block discarded – undo
53 53
     
54 54
     /**
55 55
      * 
56
-     * @param array $row
57 56
      */
58 57
     public function addRowArray($cells){
59 58
         $this->addRow(new Row($cells));
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.