Passed
Push — release_2_0 ( aff697...948471 )
by Stefan
08:18
created
core/ProfileRADIUS.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -112,9 +112,9 @@  discard block
 block discarded – undo
112 112
 
113 113
         $attributesLowLevel = array_merge($this->deviceLevelAttributes, $this->eapLevelAttributes);
114 114
 
115
-        $this->loggerInstance->debug(5, "Device-Level Attributes: " . print_r($this->deviceLevelAttributes, true));
116
-        $this->loggerInstance->debug(5, "EAP-Level Attributes: " . print_r($this->eapLevelAttributes, true));
117
-        $this->loggerInstance->debug(5, "All low-Level Attributes: " . print_r($attributesLowLevel, true));
115
+        $this->loggerInstance->debug(5, "Device-Level Attributes: ".print_r($this->deviceLevelAttributes, true));
116
+        $this->loggerInstance->debug(5, "EAP-Level Attributes: ".print_r($this->eapLevelAttributes, true));
117
+        $this->loggerInstance->debug(5, "All low-Level Attributes: ".print_r($attributesLowLevel, true));
118 118
 
119 119
         // now fetch and merge profile-level attributes if not already set on deeper level
120 120
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
             }
134 134
         }
135 135
 
136
-        $this->loggerInstance->debug(5, "Merged Attributes: " . print_r($attributesLowLevel, true));
136
+        $this->loggerInstance->debug(5, "Merged Attributes: ".print_r($attributesLowLevel, true));
137 137
 
138 138
         // now, fetch and merge IdP-wide attributes
139 139
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
                 "row" => $attributeQuery->row,
189 189
                 "flag" => $optinfo['flag'],
190 190
                 "device" => ($devicesOrEAPMethods == "DEVICES" ? $attributeQuery->deviceormethod : NULL),
191
-                "eapmethod" => ($devicesOrEAPMethods == "DEVICES" ? 0 : (new \core\common\EAP($attributeQuery->deviceormethod))->getArrayRep() )];
191
+                "eapmethod" => ($devicesOrEAPMethods == "DEVICES" ? 0 : (new \core\common\EAP($attributeQuery->deviceormethod))->getArrayRep())];
192 192
         }
193 193
         return $temparray;
194 194
     }
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
      * @return void
290 290
      */
291 291
     public function setAnonymousIDSupport($shallwe) {
292
-        $this->databaseHandle->exec("UPDATE profile SET use_anon_outer = " . ($shallwe === true ? "1" : "0") . " WHERE profile_id = $this->identifier");
292
+        $this->databaseHandle->exec("UPDATE profile SET use_anon_outer = ".($shallwe === true ? "1" : "0")." WHERE profile_id = $this->identifier");
293 293
     }
294 294
 
295 295
     /** Toggle special username for realm checks
@@ -299,8 +299,8 @@  discard block
 block discarded – undo
299 299
      * @return void
300 300
      */
301 301
     public function setRealmCheckUser($shallwe, $localpart = NULL) {
302
-        $this->databaseHandle->exec("UPDATE profile SET checkuser_outer = " . ($shallwe === true ? "1" : "0") .
303
-                ( $localpart !== NULL ? ", checkuser_value = '$localpart' " : "") .
302
+        $this->databaseHandle->exec("UPDATE profile SET checkuser_outer = ".($shallwe === true ? "1" : "0").
303
+                ($localpart !== NULL ? ", checkuser_value = '$localpart' " : "").
304 304
                 " WHERE profile_id = $this->identifier");
305 305
     }
306 306
 
@@ -312,8 +312,8 @@  discard block
 block discarded – undo
312 312
      * @return void
313 313
      */
314 314
     public function setInputVerificationPreference($verify, $hint) {
315
-        $this->databaseHandle->exec("UPDATE profile SET verify_userinput_suffix = " . ($verify === true ? "1" : "0") .
316
-                ", hint_userinput_suffix = " . ($hint === true ? "1" : "0") .
315
+        $this->databaseHandle->exec("UPDATE profile SET verify_userinput_suffix = ".($verify === true ? "1" : "0").
316
+                ", hint_userinput_suffix = ".($hint === true ? "1" : "0").
317 317
                 " WHERE profile_id = $this->identifier");
318 318
     }
319 319
 
Please login to merge, or discard this patch.
core/diag/Logopath.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
         $this->possibleFailureReasons = $_SESSION["SUSPECTS"] ?? []; // if we know nothing, don't talk to anyone
105 105
         $this->additionalFindings = $_SESSION["EVIDENCE"] ?? [];
106 106
 
107
-        $this->subjectPrefix = _("[eduroam Diagnostics]") . " ";
107
+        $this->subjectPrefix = _("[eduroam Diagnostics]")." ";
108 108
         $this->finalGreeting = "\n"
109 109
                 . _("(This service is in an early stage. We apologise if this is a false alert. If this is the case, please send an email report to [email protected], forwarding the entire message (including the 'SUSPECTS' and 'EVIDENCE' data at the end), and explain why this is a false positive.)")
110 110
                 . "\n"
111
-                . _("Yours sincerely,") . "\n"
111
+                . _("Yours sincerely,")."\n"
112 112
                 . "\n"
113 113
                 . _("Ed U. Roam, the eduroam diagnostics algorithm");
114 114
 
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
                 "bcc" => [],
120 120
                 "reply-to" => [Logopath::EDUROAM_OT],
121 121
                 "subject" => _("[POLICYVIOLATION NATIONAL] IdP with no entry in eduroam database"),
122
-                "body" => _("Dear NRO administrator,") . "\n"
122
+                "body" => _("Dear NRO administrator,")."\n"
123 123
                 . "\n"
124
-                . wordwrap(sprintf(_("an end-user requested diagnostics for realm %s. Real-time connectivity checks determined that the realm exists, but we were unable to find an IdP with that realm in the eduroam database."), "foo.bar")) . "\n"
124
+                . wordwrap(sprintf(_("an end-user requested diagnostics for realm %s. Real-time connectivity checks determined that the realm exists, but we were unable to find an IdP with that realm in the eduroam database."), "foo.bar"))."\n"
125 125
                 . "\n"
126
-                . _("By not listing IdPs in the eduroam database, you are violating the eduroam policy.") . "\n"
126
+                . _("By not listing IdPs in the eduroam database, you are violating the eduroam policy.")."\n"
127 127
                 . "\n"
128
-                . _("Additionally, this creates operational issues. In particular, we are unable to direct end users to their IdP for further diagnosis/instructions because there are no contact points for that IdP in the database.") . "\n"
128
+                . _("Additionally, this creates operational issues. In particular, we are unable to direct end users to their IdP for further diagnosis/instructions because there are no contact points for that IdP in the database.")."\n"
129 129
                 . "\n"
130 130
                 . "Please stop the policy violation ASAP by listing the IdP which is associated to this realm.",
131 131
             ],
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 
280 280
             $handle = \core\common\OutsideComm::mailHandle();
281 281
             // let's identify outselves
282
-            $handle->FromName = CONFIG['APPEARANCE']['productname'] . " Real-Time Diagnostics System";
282
+            $handle->FromName = CONFIG['APPEARANCE']['productname']." Real-Time Diagnostics System";
283 283
             // add recipients
284 284
             foreach (Logopath::CATEGORYBINDING as $arrayName => $functionName) {
285 285
                 foreach ($theMail[$arrayName] as $onePrincipal) {
Please login to merge, or discard this patch.
core/diag/Telepath.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
 use \Exception;
25 25
 
26
-require_once dirname(dirname(__DIR__)) . "/config/_config.php";
26
+require_once dirname(dirname(__DIR__))."/config/_config.php";
27 27
 
28 28
 /**
29 29
  * The overall coordination class that runs all kinds of tests to find out where
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         if ($this->idPFederation === NULL && preg_match("/\.(..)$/", $realm, $matches)) {
76 76
             $this->idPFederation = strtoupper($matches[1]);
77 77
         }
78
-        $this->loggerInstance->debug(4, "XYZ: IdP-side NRO is " . $this->idPFederation . "\n");
78
+        $this->loggerInstance->debug(4, "XYZ: IdP-side NRO is ".$this->idPFederation."\n");
79 79
     }
80 80
 
81 81
     /* The eduroam OT monitoring has the following return codes:
@@ -397,12 +397,12 @@  discard block
 block discarded – undo
397 397
                     break;
398 398
                 case \core\AbstractProfile::READINESS_LEVEL_NOTREADY:
399 399
                     $this->additionalFindings[AbstractTest::INFRA_IDP_RADIUS][] = ["Profile" => "UNCONCLUSIVE"];
400
-                    $this->testsuite = new RADIUSTests($this->realm, "anonymous@" . $this->realm);
400
+                    $this->testsuite = new RADIUSTests($this->realm, "anonymous@".$this->realm);
401 401
                     break;
402 402
                 default:
403 403
             }
404 404
         } else {
405
-            $this->testsuite = new RADIUSTests($this->realm, "anonymous@" . $this->realm);
405
+            $this->testsuite = new RADIUSTests($this->realm, "anonymous@".$this->realm);
406 406
         }
407 407
     }
408 408
 
Please login to merge, or discard this patch.
core/Options.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -142,17 +142,17 @@  discard block
 block discarded – undo
142 142
         foreach (array_keys($this->typeDb) as $name) {
143 143
             if ($className === 0) {
144 144
                 $tempArray[] = $name;
145
-            } elseif (preg_match('/^' . $className . ':/', $name) > 0) {
145
+            } elseif (preg_match('/^'.$className.':/', $name) > 0) {
146 146
                 $tempArray[] = $name;
147 147
             }
148 148
         }
149 149
         $returnArray = $tempArray;
150 150
         // remove silverbullet-specific options if this deployment is not SB
151 151
         foreach ($tempArray as $key => $val) {
152
-            if (( CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] != 'LOCAL') && (preg_match('/^fed:silverbullet/', $val) > 0)) {
152
+            if ((CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] != 'LOCAL') && (preg_match('/^fed:silverbullet/', $val) > 0)) {
153 153
                 unset($returnArray[$key]);
154 154
             }
155
-            if (( CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] != 'LOCAL') && (preg_match('/^fed:minted_ca_file/', $val) > 0)) {
155
+            if ((CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] != 'LOCAL') && (preg_match('/^fed:minted_ca_file/', $val) > 0)) {
156 156
                 unset($returnArray[$key]);
157 157
             }
158 158
         }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         if (isset($this->typeDb[$optionname])) {
172 172
             return $this->typeDb[$optionname];
173 173
         }
174
-        throw new Exception("Metadata about an option was requested, but the option name does not exist in the system: " . htmlentities($optionname));
174
+        throw new Exception("Metadata about an option was requested, but the option name does not exist in the system: ".htmlentities($optionname));
175 175
     }
176 176
 
177 177
     /**
Please login to merge, or discard this patch.
core/DeviceFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
         parent::__construct();
59 59
         $Dev = \devices\Devices::listDevices();
60 60
         if (isset($Dev[$blueprint])) {
61
-            $this->loggerInstance->debug(4, "loaded: devices/" . $Dev[$blueprint]['directory'] . "/" . $Dev[$blueprint]['module'] . ".php\n");
62
-            $class_name = "\devices\\".$Dev[$blueprint]['directory']."\Device_" . $Dev[$blueprint]['module'];
61
+            $this->loggerInstance->debug(4, "loaded: devices/".$Dev[$blueprint]['directory']."/".$Dev[$blueprint]['module'].".php\n");
62
+            $class_name = "\devices\\".$Dev[$blueprint]['directory']."\Device_".$Dev[$blueprint]['module'];
63 63
             $this->device = new $class_name();
64 64
             if (!$this->device) {
65 65
                 $this->loggerInstance->debug(2, "module loading failed");
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         } else {
69 69
             print("unknown devicename:$blueprint\n");
70 70
         }
71
-        $this->device->module_path = ROOT . '/devices/' . $Dev[$blueprint]['directory'];
71
+        $this->device->module_path = ROOT.'/devices/'.$Dev[$blueprint]['directory'];
72 72
         $this->device->signer = isset($Dev[$blueprint]['signer']) ? $Dev[$blueprint]['signer'] : 0;
73 73
         $this->device->device_id = $blueprint;
74 74
         $options = \devices\Devices::$Options;
Please login to merge, or discard this patch.
core/common/Logging.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
 use \Exception;
25 25
 
26
-require_once dirname(dirname(__DIR__)) . "/config/_config.php";
26
+require_once dirname(dirname(__DIR__))."/config/_config.php";
27 27
 
28 28
 class Logging {
29 29
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      * @return void
46 46
      */
47 47
     private function writeToFile($filename, $message) {
48
-        file_put_contents(CONFIG['PATHS']['logdir'] . "/$filename", sprintf("%-015s", microtime(TRUE)) . $message, FILE_APPEND);
48
+        file_put_contents(CONFIG['PATHS']['logdir']."/$filename", sprintf("%-015s", microtime(TRUE)).$message, FILE_APPEND);
49 49
     }
50 50
 
51 51
     /**
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         } else {
77 77
             $output .= var_export($stuff, TRUE);
78 78
         }
79
-        $output = $prefix . $output . $suffix;
79
+        $output = $prefix.$output.$suffix;
80 80
         $this->writeToFile("debug.log", $output);
81 81
 
82 82
         return;
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         $logTextStep1 = preg_replace("/[\n\r]/", "", $query);
122 122
         $logTextStep2 = preg_replace("/ +/", " ", $logTextStep1);
123 123
         $logTextStep3 = iconv("UTF-8", "UTF-8//IGNORE", $logTextStep2);
124
-        $this->writeToFile("audit-SQL.log", " " . $logTextStep3 . "\n");
124
+        $this->writeToFile("audit-SQL.log", " ".$logTextStep3."\n");
125 125
     }
126 126
 
127 127
 }
Please login to merge, or discard this patch.
core/common/X509.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
      */
84 84
     public function der2pem($derData) {
85 85
         $pem = chunk_split(base64_encode($derData), 64, "\n");
86
-        $pem = "-----BEGIN CERTIFICATE-----\n" . $pem . "-----END CERTIFICATE-----\n";
86
+        $pem = "-----BEGIN CERTIFICATE-----\n".$pem."-----END CERTIFICATE-----\n";
87 87
         return $pem;
88 88
     }
89 89
 
Please login to merge, or discard this patch.
core/common/EAP.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -165,8 +165,8 @@
 block discarded – undo
165 165
             $key = array_search($eapType, EAP::EAPTYPES_CONVERSION);
166 166
             if ($key !== FALSE) {
167 167
                 // add a type cast to int to make Scrutinizer realise that the key found is always an integer
168
-                $this->intRep = (int)$key; // array index is always an integer
169
-                $this->arrayRep = EAP::EAPTYPES_CONVERSION[(int)$key];
168
+                $this->intRep = (int) $key; // array index is always an integer
169
+                $this->arrayRep = EAP::EAPTYPES_CONVERSION[(int) $key];
170 170
                 return;
171 171
             }
172 172
         }
Please login to merge, or discard this patch.
core/common/Language.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
  */
31 31
 namespace core\common;
32 32
 
33
-require_once dirname(dirname(__DIR__)) . "/config/_config.php";
33
+require_once dirname(dirname(__DIR__))."/config/_config.php";
34 34
 
35 35
 /**
36 36
  * This class maintains state of the selected language and can set the language.
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
         $loggerInstance = new \core\common\Logging();
73 73
         $olddomain = textdomain(NULL);
74 74
         $loggerInstance->debug(4, "set_locale($domain)\n");
75
-        $loggerInstance->debug(4, ROOT . "\n");
75
+        $loggerInstance->debug(4, ROOT."\n");
76 76
         textdomain($domain);
77
-        bindtextdomain($domain, ROOT . "/translation/");
77
+        bindtextdomain($domain, ROOT."/translation/");
78 78
         return $olddomain;
79 79
     }
80 80
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             $langConverted[] = $hardSetLang;
97 97
         }
98 98
         if (!empty($_REQUEST['lang'])) {
99
-            $recoverLang = filter_input(INPUT_GET,'lang', FILTER_SANITIZE_STRING) ?? filter_input(INPUT_POST, 'lang', FILTER_SANITIZE_STRING);
99
+            $recoverLang = filter_input(INPUT_GET, 'lang', FILTER_SANITIZE_STRING) ?? filter_input(INPUT_POST, 'lang', FILTER_SANITIZE_STRING);
100 100
             $langConverted[] = $recoverLang;
101 101
         }
102 102
         CAT_session_start();
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             $langConverted[] = $_SESSION['language'];
105 105
         }
106 106
         if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
107
-            $langs = explode(",", filter_input(INPUT_SERVER,"HTTP_ACCEPT_LANGUAGE", FILTER_SANITIZE_STRING));
107
+            $langs = explode(",", filter_input(INPUT_SERVER, "HTTP_ACCEPT_LANGUAGE", FILTER_SANITIZE_STRING));
108 108
             foreach ($langs as $lang) {
109 109
                 $result = [];
110 110
                 preg_match("/(.*);+.*/", $lang, $result);
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 
125 125
             // check if this language is supported by the CAT config
126 126
             foreach (CONFIG['LANGUAGES'] as $language => $value) {
127
-                if (preg_match("/^" . $language . ".*/", $tryLang)) {
127
+                if (preg_match("/^".$language.".*/", $tryLang)) {
128 128
                     $localeTmp = $value['locale'];
129 129
                     $langIndex = $language; // ???
130 130
                     break;
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                 }
140 140
             }
141 141
         }
142
-        putenv("LC_ALL=" . $theLocale);
142
+        putenv("LC_ALL=".$theLocale);
143 143
         $_SESSION['language'] = $langIndex;
144 144
         $loggerInstance = new \core\common\Logging();
145 145
         $loggerInstance->debug(4, "selected lang:$langIndex:$theLocale\n");
Please login to merge, or discard this patch.