Passed
Push — release_2_0 ( 46c9ba...b90bc6 )
by Tomasz
07:37
created
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/DBConnection.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
 use \Exception;
34 34
 
35
-require_once dirname(__DIR__) . "/config/_config.php";
35
+require_once dirname(__DIR__)."/config/_config.php";
36 36
 
37 37
 /**
38 38
  * This class is a singleton for establishing a connection to the database
@@ -59,14 +59,14 @@  discard block
 block discarded – undo
59 59
             case "USER":
60 60
             case "EXTERNAL":
61 61
             case "FRONTEND":
62
-                if (!isset(self::${"instance" . $theDb})) {
62
+                if (!isset(self::${"instance".$theDb})) {
63 63
                     $class = __CLASS__;
64
-                    self::${"instance" . $theDb} = new $class($database);
65
-                    DBConnection::${"instance" . $theDb}->databaseInstance = $theDb;
64
+                    self::${"instance".$theDb} = new $class($database);
65
+                    DBConnection::${"instance".$theDb}->databaseInstance = $theDb;
66 66
                 }
67
-                return self::${"instance" . $theDb};
67
+                return self::${"instance".$theDb};
68 68
             default:
69
-                throw new Exception("This type of database (" . strtoupper($database) . ") is not known!");
69
+                throw new Exception("This type of database (".strtoupper($database).") is not known!");
70 70
         }
71 71
     }
72 72
 
@@ -105,18 +105,18 @@  discard block
 block discarded – undo
105 105
             }
106 106
         }
107 107
         // log exact query to debug log, if log level is at 5
108
-        $this->loggerInstance->debug(5, "DB ATTEMPT: " . $querystring . "\n");
108
+        $this->loggerInstance->debug(5, "DB ATTEMPT: ".$querystring."\n");
109 109
         if ($types !== NULL) {
110
-            $this->loggerInstance->debug(5, "Argument type sequence: $types, parameters are: " . print_r($arguments, true));
110
+            $this->loggerInstance->debug(5, "Argument type sequence: $types, parameters are: ".print_r($arguments, true));
111 111
         }
112 112
 
113 113
         if ($this->connection->connect_error) {
114
-            throw new Exception("ERROR: Cannot send query to $this->databaseInstance database (no connection, error number" . $this->connection->connect_error . ")!");
114
+            throw new Exception("ERROR: Cannot send query to $this->databaseInstance database (no connection, error number".$this->connection->connect_error.")!");
115 115
         }
116 116
         if ($types === NULL) {
117 117
             $result = $this->connection->query($querystring);
118 118
             if ($result === FALSE) {
119
-                throw new Exception("DB: Unable to execute simple statement! Error was --> " . $this->connection->error . " <--");
119
+                throw new Exception("DB: Unable to execute simple statement! Error was --> ".$this->connection->error." <--");
120 120
             }
121 121
         } else {
122 122
             // fancy! prepared statement with dedicated argument list
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
             }
130 130
             $prepResult = $statementObject->prepare($querystring);
131 131
             if ($prepResult === FALSE) {
132
-                throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> " . $statementObject->error . " <--.");
132
+                throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> ".$statementObject->error." <--.");
133 133
             }
134 134
 
135 135
             // we have a variable number of arguments packed into the ... array
@@ -141,11 +141,11 @@  discard block
 block discarded – undo
141 141
             array_unshift($localArray, $types);
142 142
             $retval = call_user_func_array([$statementObject, "bind_param"], $localArray);
143 143
             if ($retval === FALSE) {
144
-                throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> " . var_export($localArray, TRUE) . " <--. Error was --> " . $statementObject->error . " <--");
144
+                throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> ".var_export($localArray, TRUE)." <--. Error was --> ".$statementObject->error." <--");
145 145
             }
146 146
             $result = $statementObject->execute();
147 147
             if ($result === FALSE) {
148
-                throw new Exception("DB: Unable to execute prepared statement! Error was --> " . $statementObject->error . " <--");
148
+                throw new Exception("DB: Unable to execute prepared statement! Error was --> ".$statementObject->error." <--");
149 149
             }
150 150
             $selectResult = $statementObject->get_result();
151 151
             if ($selectResult !== FALSE) {
@@ -157,14 +157,14 @@  discard block
 block discarded – undo
157 157
 
158 158
         // all cases where $result could be FALSE have been caught earlier
159 159
         if ($this->connection->errno) {
160
-            throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was " . $this->connection->errno . "!");
160
+            throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was ".$this->connection->errno."!");
161 161
         }
162 162
 
163 163
 
164 164
         if ($isMoreThanSelect) {
165
-            $this->loggerInstance->writeSQLAudit("[DB: " . strtoupper($this->databaseInstance) . "] " . $querystring);
165
+            $this->loggerInstance->writeSQLAudit("[DB: ".strtoupper($this->databaseInstance)."] ".$querystring);
166 166
             if ($types !== NULL) {
167
-                $this->loggerInstance->writeSQLAudit("Argument type sequence: $types, parameters are: " . print_r($arguments, true));
167
+                $this->loggerInstance->writeSQLAudit("Argument type sequence: $types, parameters are: ".print_r($arguments, true));
168 168
             }
169 169
         }
170 170
         return $result;
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
         $databaseCapitalised = strtoupper($database);
242 242
         $this->connection = new \mysqli(CONFIG['DB'][$databaseCapitalised]['host'], CONFIG['DB'][$databaseCapitalised]['user'], CONFIG['DB'][$databaseCapitalised]['pass'], CONFIG['DB'][$databaseCapitalised]['db']);
243 243
         if ($this->connection->connect_error) {
244
-            throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number " . $this->connection->connect_errno . ").");
244
+            throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number ".$this->connection->connect_errno.").");
245 245
         }
246 246
 
247 247
         if ($databaseCapitalised == "EXTERNAL" && CONFIG_CONFASSISTANT['CONSORTIUM']['name'] == "eduroam" && isset(CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo']) && CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo'] == "Operations Team") {
Please login to merge, or discard this patch.
core/UserAPI.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         $this->installerPath = $cache['path'];
83 83
         if ($this->installerPath !== NULL && $token === NULL && $password === NULL) {
84 84
             $this->loggerInstance->debug(4, "Using cached installer for: $device\n");
85
-            $installerProperties['link'] = "API.php?action=downloadInstaller&lang=" . $this->languageInstance->getLang() . "&profile=$profileId&device=$device&generatedfor=$generatedFor";
85
+            $installerProperties['link'] = "API.php?action=downloadInstaller&lang=".$this->languageInstance->getLang()."&profile=$profileId&device=$device&generatedfor=$generatedFor";
86 86
             $installerProperties['mime'] = $cache['mime'];
87 87
         } else {
88 88
             $myInstaller = $this->generateNewInstaller($device, $profile, $generatedFor, $token, $password);
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
             $this->loggerInstance->debug(5, "generateNewInstaller() - Device setup done");
165 165
             $installer = $dev->writeInstaller();
166 166
             $this->loggerInstance->debug(5, "generateNewInstaller() - writeInstaller complete");
167
-            $iPath = $dev->FPATH . '/tmp/' . $installer;
167
+            $iPath = $dev->FPATH.'/tmp/'.$installer;
168 168
             if ($iPath && is_file($iPath)) {
169 169
                 if (isset($dev->options['mime'])) {
170 170
                     $out['mime'] = $dev->options['mime'];
@@ -172,17 +172,17 @@  discard block
 block discarded – undo
172 172
                     $info = new \finfo();
173 173
                     $out['mime'] = $info->file($iPath, FILEINFO_MIME_TYPE);
174 174
                 }
175
-                $this->installerPath = $dev->FPATH . '/' . $installer;
175
+                $this->installerPath = $dev->FPATH.'/'.$installer;
176 176
                 rename($iPath, $this->installerPath);
177 177
                 $integerEap = (new \core\common\EAP($dev->selectedEap))->getIntegerRep();
178 178
                 $profile->updateCache($device, $this->installerPath, $out['mime'], $integerEap);
179 179
                 if (CONFIG['DEBUG_LEVEL'] < 4) {
180
-                    \core\common\Entity::rrmdir($dev->FPATH . '/tmp');
180
+                    \core\common\Entity::rrmdir($dev->FPATH.'/tmp');
181 181
                 }
182
-                $this->loggerInstance->debug(4, "Generated installer: " . $this->installerPath . ": for: $device, EAP:" . $integerEap . "\n");
183
-                $out['link'] = "API.php?action=downloadInstaller&lang=" . $this->languageInstance->getLang() . "&profile=" . $profile->identifier . "&device=$device&generatedfor=$generatedFor";
182
+                $this->loggerInstance->debug(4, "Generated installer: ".$this->installerPath.": for: $device, EAP:".$integerEap."\n");
183
+                $out['link'] = "API.php?action=downloadInstaller&lang=".$this->languageInstance->getLang()."&profile=".$profile->identifier."&device=$device&generatedfor=$generatedFor";
184 184
             } else {
185
-                $this->loggerInstance->debug(2, "Installer generation failed for: " . $profile->identifier . ":$device:" . $this->languageInstance->getLang() . "\n");
185
+                $this->loggerInstance->debug(2, "Installer generation failed for: ".$profile->identifier.":$device:".$this->languageInstance->getLang()."\n");
186 186
                 $out['link'] = 0;
187 187
             }
188 188
         }
@@ -294,9 +294,9 @@  discard block
 block discarded – undo
294 294
         $file = $this->installerPath;
295 295
         $filetype = $output['mime'];
296 296
         $this->loggerInstance->debug(4, "installer MIME type:$filetype\n");
297
-        header("Content-type: " . $filetype);
298
-        header('Content-Disposition: inline; filename="' . basename($file) . '"');
299
-        header('Content-Length: ' . filesize($file));
297
+        header("Content-type: ".$filetype);
298
+        header('Content-Disposition: inline; filename="'.basename($file).'"');
299
+        header('Content-Length: '.filesize($file));
300 300
         ob_clean();
301 301
         flush();
302 302
         readfile($file);
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
         $filetype = $info->buffer($inputImage, FILEINFO_MIME_TYPE);
318 318
         $offset = 60 * 60 * 24 * 30;
319 319
         // gmdate cannot fail here - time() is its default argument (and integer), and we are adding an integer to it
320
-        $expiresString = "Expires: " . /** @scrutinizer ignore-type */ gmdate("D, d M Y H:i:s", time() + $offset) . " GMT";
320
+        $expiresString = "Expires: "./** @scrutinizer ignore-type */ gmdate("D, d M Y H:i:s", time() + $offset)." GMT";
321 321
         $blob = $inputImage;
322 322
 
323 323
         if ($resize === TRUE) {
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
         $filetype = 'image/png'; // default, only one code path where it can become different
372 372
         list($width, $height, $resize) = $this->testForResize($widthIn, $heightIn);
373 373
         if ($resize) {
374
-            $logoFile = ROOT . '/web/downloads/logos/' . $identifier . '_' . $width . '_' . $height . '.png';
374
+            $logoFile = ROOT.'/web/downloads/logos/'.$identifier.'_'.$width.'_'.$height.'.png';
375 375
         }
376 376
         if (is_file($logoFile)) { // $logoFile could be an empty string but then we will get a FALSE
377 377
             $this->loggerInstance->debug(4, "Using cached logo $logoFile for: $identifier\n");
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
             if (count($logoAttribute) == 0) {
382 382
                 return NULL;
383 383
             }
384
-            $this->loggerInstance->debug(4,"RESIZE:$width:$height\n");
384
+            $this->loggerInstance->debug(4, "RESIZE:$width:$height\n");
385 385
             $meta = $this->processImage($logoAttribute[0]['value'], $logoFile, $width, $height, $resize);
386 386
             $filetype = $meta['filetype'];
387 387
             $expiresString = $meta['expires'];
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
             if (!isset($device['match'])) {
462 462
                 continue;
463 463
             }
464
-            if (preg_match('/' . $device['match'] . '/', $browser)) {
464
+            if (preg_match('/'.$device['match'].'/', $browser)) {
465 465
                 return $this->returnDevice($devId, $device);
466 466
             }
467 467
         }
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/OutsideComm.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
             $loggerInstance->debug(4, "OutsideComm::mailAddressValidSecure: no MX.");
118 118
             return OutsideComm::MAILDOMAIN_NO_MX;
119 119
         }
120
-        $loggerInstance->debug(5, "Domain: $domain MX: " . print_r($mx, TRUE));
120
+        $loggerInstance->debug(5, "Domain: $domain MX: ".print_r($mx, TRUE));
121 121
         // create a pool of A and AAAA records for all the MXes
122 122
         $ipAddrs = [];
123 123
         foreach ($mx as $onemx) {
@@ -127,14 +127,14 @@  discard block
 block discarded – undo
127 127
                 $ipAddrs[] = $oneipv4['ip'];
128 128
             }
129 129
             foreach ($v6list as $oneipv6) {
130
-                $ipAddrs[] = "[" . $oneipv6['ipv6'] . "]";
130
+                $ipAddrs[] = "[".$oneipv6['ipv6']."]";
131 131
             }
132 132
         }
133 133
         if (count($ipAddrs) == 0) {
134 134
             $loggerInstance->debug(4, "OutsideComm::mailAddressValidSecure: no mailserver hosts.");
135 135
             return OutsideComm::MAILDOMAIN_NO_HOST;
136 136
         }
137
-        $loggerInstance->debug(5, "Domain: $domain Addrs: " . print_r($ipAddrs, TRUE));
137
+        $loggerInstance->debug(5, "Domain: $domain Addrs: ".print_r($ipAddrs, TRUE));
138 138
         // connect to all hosts. If all can't connect, return MAILDOMAIN_NO_CONNECT. 
139 139
         // If at least one does not support STARTTLS or one of the hosts doesn't connect
140 140
         // , return MAILDOMAIN_NO_STARTTLS (one which we can't connect to we also
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         switch (CONFIG_CONFASSISTANT['SMSSETTINGS']['provider']) {
187 187
             case 'Nexmo':
188 188
                 // taken from https://docs.nexmo.com/messaging/sms-api
189
-                $url = 'https://rest.nexmo.com/sms/json?' . http_build_query(
189
+                $url = 'https://rest.nexmo.com/sms/json?'.http_build_query(
190 190
                                 [
191 191
                                     'api_key' => CONFIG_CONFASSISTANT['SMSSETTINGS']['username'],
192 192
                                     'api_secret' => CONFIG_CONFASSISTANT['SMSSETTINGS']['password'],
@@ -208,14 +208,14 @@  discard block
 block discarded – undo
208 208
                     $loggerInstance->debug(2, 'Problem with SMS invitation: no message was sent!');
209 209
                     return OutsideComm::SMS_NOTSENT;
210 210
                 }
211
-                $loggerInstance->debug(2, 'Total of ' . $messageCount . ' messages were attempted to send.');
211
+                $loggerInstance->debug(2, 'Total of '.$messageCount.' messages were attempted to send.');
212 212
 
213 213
                 $totalFailures = 0;
214 214
                 foreach ($decoded_response['messages'] as $message) {
215 215
                     if ($message['status'] == 0) {
216
-                        $loggerInstance->debug(2, $message['message-id'] . ": Success");
216
+                        $loggerInstance->debug(2, $message['message-id'].": Success");
217 217
                     } else {
218
-                        $loggerInstance->debug(2, $message['message-id'] . ": Failed (failure code = " . $message['status'] . ")");
218
+                        $loggerInstance->debug(2, $message['message-id'].": Failed (failure code = ".$message['status'].")");
219 219
                         $totalFailures++;
220 220
                     }
221 221
                 }
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
             $proto = "https://";
268 268
         }
269 269
         // then, send out the mail
270
-        $message = _("Hello,") . "\n\n" . wordwrap($introTexts[$introtext] . " " . $validity, 72) . "\n\n";
270
+        $message = _("Hello,")."\n\n".wordwrap($introTexts[$introtext]." ".$validity, 72)."\n\n";
271 271
         // default means we don't have a Reply-To.
272 272
         $replyToMessage = wordwrap(_("manually. Please do not reply to this mail; this is a send-only address."));
273 273
 
@@ -275,8 +275,8 @@  discard block
 block discarded – undo
275 275
             // see if we are supposed to add a custom message
276 276
             $customtext = $federation->getAttributes('fed:custominvite');
277 277
             if (count($customtext) > 0) {
278
-                $message .= wordwrap(sprintf(_("Additional message from your %s administrator:"), Entity::$nomenclature_fed), 72) . "\n---------------------------------" .
279
-                        wordwrap($customtext[0]['value'], 72) . "\n---------------------------------\n\n";
278
+                $message .= wordwrap(sprintf(_("Additional message from your %s administrator:"), Entity::$nomenclature_fed), 72)."\n---------------------------------".
279
+                        wordwrap($customtext[0]['value'], 72)."\n---------------------------------\n\n";
280 280
             }
281 281
             // and add Reply-To already now
282 282
             foreach ($federation->listFederationAdmins() as $fedadmin_id) {
@@ -291,19 +291,19 @@  discard block
 block discarded – undo
291 291
             }
292 292
         }
293 293
 
294
-        $message .= wordwrap(sprintf(_("To enlist as an administrator for that %s, please click on the following link:"), Entity::$nomenclature_inst), 72) . "\n\n" .
295
-                $proto . $_SERVER['SERVER_NAME'] . CONFIG['PATHS']['cat_base_url'] . "admin/action_enrollment.php?token=$newtoken\n\n" .
296
-                wordwrap(sprintf(_("If clicking the link doesn't work, you can also go to the %s Administrator Interface at"), CONFIG['APPEARANCE']['productname']), 72) . "\n\n" .
297
-                $proto . $_SERVER['SERVER_NAME'] . CONFIG['PATHS']['cat_base_url'] . "admin/\n\n" .
298
-                _("and enter the invitation token") . "\n\n" .
299
-                $newtoken . "\n\n$replyToMessage\n\n" .
300
-                wordwrap(_("Do NOT forward the mail before the token has expired - or the recipients may be able to consume the token on your behalf!"), 72) . "\n\n" .
301
-                wordwrap(sprintf(_("We wish you a lot of fun with the %s."), CONFIG['APPEARANCE']['productname']), 72) . "\n\n" .
294
+        $message .= wordwrap(sprintf(_("To enlist as an administrator for that %s, please click on the following link:"), Entity::$nomenclature_inst), 72)."\n\n".
295
+                $proto.$_SERVER['SERVER_NAME'].CONFIG['PATHS']['cat_base_url']."admin/action_enrollment.php?token=$newtoken\n\n".
296
+                wordwrap(sprintf(_("If clicking the link doesn't work, you can also go to the %s Administrator Interface at"), CONFIG['APPEARANCE']['productname']), 72)."\n\n".
297
+                $proto.$_SERVER['SERVER_NAME'].CONFIG['PATHS']['cat_base_url']."admin/\n\n".
298
+                _("and enter the invitation token")."\n\n".
299
+                $newtoken."\n\n$replyToMessage\n\n".
300
+                wordwrap(_("Do NOT forward the mail before the token has expired - or the recipients may be able to consume the token on your behalf!"), 72)."\n\n".
301
+                wordwrap(sprintf(_("We wish you a lot of fun with the %s."), CONFIG['APPEARANCE']['productname']), 72)."\n\n".
302 302
                 sprintf(_("Sincerely,\n\nYour friendly folks from %s Operations"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
303 303
 
304 304
 
305 305
 // who to whom?
306
-        $mail->FromName = CONFIG['APPEARANCE']['productname'] . " Invitation System";
306
+        $mail->FromName = CONFIG['APPEARANCE']['productname']." Invitation System";
307 307
 
308 308
         if (isset(CONFIG['APPEARANCE']['invitation-bcc-mail']) && CONFIG['APPEARANCE']['invitation-bcc-mail'] !== NULL) {
309 309
             $mail->addBCC(CONFIG['APPEARANCE']['invitation-bcc-mail']);
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.