Passed
Push — master ( 5182b6...aa5b46 )
by Stefan
14:58 queued 01:13
created
core/common/Entity.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      */
109 109
     public function __construct() {
110 110
         $this->loggerInstance = new Logging();
111
-        $this->loggerInstance->debug(3, "--- BEGIN constructing class " . get_class($this) . " .\n");
111
+        $this->loggerInstance->debug(3, "--- BEGIN constructing class ".get_class($this)." .\n");
112 112
         $this->languageInstance = new Language();
113 113
         Entity::intoThePotatoes();
114 114
         // some config elements are displayable. We need some dummies to 
@@ -127,13 +127,13 @@  discard block
 block discarded – undo
127 127
         $dummy_organisation2a = _("organization");
128 128
         $dummy_organisation3 = _("entity");
129 129
         // and do something useless with the strings so that there's no "unused" complaint
130
-        if (strlen($dummy_NRO . $dummy_inst1 . $dummy_inst2 . $dummy_inst3 . $dummy_hotspot1 . $dummy_hotspot2 . $dummy_hotspot3 . $dummy_organisation1 . $dummy_organisation2 . $dummy_organisation2a . $dummy_organisation3) < 0) {
130
+        if (strlen($dummy_NRO.$dummy_inst1.$dummy_inst2.$dummy_inst3.$dummy_hotspot1.$dummy_hotspot2.$dummy_hotspot3.$dummy_organisation1.$dummy_organisation2.$dummy_organisation2a.$dummy_organisation3) < 0) {
131 131
             throw new Exception("Strings are usually not shorter than 0 characters. We've encountered a string blackhole.");
132 132
         }
133
-        $variableFed = \config\ConfAssistant::CONSORTIUM['nomenclature_federation'] . "";
134
-        $variableInst = \config\ConfAssistant::CONSORTIUM['nomenclature_institution'] . "";
135
-        $variableHotspot = \config\ConfAssistant::CONSORTIUM['nomenclature_hotspot'] . "";
136
-        $variableParticipant = \config\ConfAssistant::CONSORTIUM['nomenclature_participant'] . "";
133
+        $variableFed = \config\ConfAssistant::CONSORTIUM['nomenclature_federation']."";
134
+        $variableInst = \config\ConfAssistant::CONSORTIUM['nomenclature_institution']."";
135
+        $variableHotspot = \config\ConfAssistant::CONSORTIUM['nomenclature_hotspot']."";
136
+        $variableParticipant = \config\ConfAssistant::CONSORTIUM['nomenclature_participant']."";
137 137
         Entity::$nomenclature_fed = _($variableFed);
138 138
         Entity::$nomenclature_inst = _($variableInst);
139 139
         Entity::$nomenclature_hotspot = _($variableHotspot);
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      * Logs the end of lifetime of the entity to the debug log on level 5.
149 149
      */
150 150
     public function __destruct() {
151
-        (new Logging())->debug(5, "--- KILL Destructing class " . get_class($this) . " .\n");
151
+        (new Logging())->debug(5, "--- KILL Destructing class ".get_class($this)." .\n");
152 152
     }
153 153
 
154 154
     /**
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
      */
180 180
     public static function createTemporaryDirectory($purpose = 'installer', $failIsFatal = 1) {
181 181
         $loggerInstance = new Logging();
182
-        $name = md5(time() . rand());
182
+        $name = md5(time().rand());
183 183
         $path = ROOT;
184 184
         switch ($purpose) {
185 185
             case 'silverbullet':
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
             default:
198 198
                 throw new Exception("unable to create temporary directory due to unknown purpose: $purpose\n");
199 199
         }
200
-        $tmpDir = $path . '/' . $name;
200
+        $tmpDir = $path.'/'.$name;
201 201
         $loggerInstance->debug(4, "temp dir: $purpose : $tmpDir\n");
202 202
         if (!mkdir($tmpDir, 0700, true)) {
203 203
             if ($failIsFatal) {
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
      * @return void
218 218
      */
219 219
     public static function rrmdir($dir) {
220
-        foreach (glob($dir . '/*') as $file) {
220
+        foreach (glob($dir.'/*') as $file) {
221 221
             if (is_dir($file)) {
222 222
                 Entity::rrmdir($file);
223 223
             } else {
@@ -242,12 +242,12 @@  discard block
 block discarded – undo
242 242
         }
243 243
         // these substr() are guaranteed to yield actual string data, as the
244 244
         // base string is an MD5 hash - has sufficient length
245
-        $uuid = /** @scrutinizer ignore-type */ substr($chars, 0, 8) . '-';
246
-        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 8, 4) . '-';
247
-        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 12, 4) . '-';
248
-        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 16, 4) . '-';
245
+        $uuid = /** @scrutinizer ignore-type */ substr($chars, 0, 8).'-';
246
+        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 8, 4).'-';
247
+        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 12, 4).'-';
248
+        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 16, 4).'-';
249 249
         $uuid .= /** @scrutinizer ignore-type */ substr($chars, 20, 12);
250
-        return $prefix . $uuid;
250
+        return $prefix.$uuid;
251 251
     }
252 252
 
253 253
     /**
@@ -292,8 +292,8 @@  discard block
 block discarded – undo
292 292
         // if called from a class, guess based on the class name; 
293 293
         // otherwise, on the filename relative to ROOT
294 294
         $myName = $caller['class'] ?? substr($caller['file'], strlen(ROOT));
295
-        $loggerInstance->debug(1,$caller);
296
-        $loggerInstance->debug(1,"\nFOUND ".$myName."\n");
295
+        $loggerInstance->debug(1, $caller);
296
+        $loggerInstance->debug(1, "\nFOUND ".$myName."\n");
297 297
         if (preg_match("/diag/", $myName) == 1) {
298 298
             $ret = "diagnostics";
299 299
         } elseif (preg_match("/core/", $myName) == 1) {
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
         } else {
308 308
             $ret = "web_user";
309 309
         }
310
-        $loggerInstance->debug(1,"\nRETURNING ".$ret."\n");
310
+        $loggerInstance->debug(1, "\nRETURNING ".$ret."\n");
311 311
         return $ret;
312 312
     }
313 313
 
@@ -325,10 +325,10 @@  discard block
 block discarded – undo
325 325
         if ($catalogue === NULL) {
326 326
             $theCatalogue = Entity::determineOwnCatalogue();
327 327
             textdomain($theCatalogue);
328
-            bindtextdomain($theCatalogue, ROOT . "/translation/");
328
+            bindtextdomain($theCatalogue, ROOT."/translation/");
329 329
         } else {
330 330
             textdomain($catalogue);
331
-            bindtextdomain($catalogue, ROOT . "/translation/");
331
+            bindtextdomain($catalogue, ROOT."/translation/");
332 332
         }
333 333
     }
334 334
 
Please login to merge, or discard this patch.