Test Failed
Push — master ( 8d6a7b...81a1e2 )
by Tomasz
11:43
created
core/ExternalEduroamDBData.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
             return $this->counter;
143 143
         }
144 144
 
145
-        $cachedNumber = @file_get_contents(ROOT . "/var/tmp/cachedSPNumber.serialised");
145
+        $cachedNumber = @file_get_contents(ROOT."/var/tmp/cachedSPNumber.serialised");
146 146
         if ($cachedNumber !== FALSE) {
147 147
             $numberData = unserialize($cachedNumber);
148 148
             $now = new \DateTime();
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         } else { // data in cache is too old or doesn't exist. We really need to ask the database
156 156
             $list = $this->listAllServiceProviders();
157 157
             $this->counter = count($list);
158
-            file_put_contents(ROOT . "/var/tmp/cachedSPNumber.serialised", serialize(["number" => $this->counter, "timestamp" => new \DateTime()]));
158
+            file_put_contents(ROOT."/var/tmp/cachedSPNumber.serialised", serialize(["number" => $this->counter, "timestamp" => new \DateTime()]));
159 159
             return $this->counter;
160 160
         }
161 161
     }
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
         $returnarray = [];
247 247
         $query = "SELECT instid AS id, country, inst_realm as realmlist, name AS collapsed_name, contact AS collapsed_contact, type FROM view_active_institution WHERE country = ?";
248 248
         if ($eduroamDbType !== NULL) {
249
-            $query .= " AND ( type = '" . ExternalEduroamDBData::TYPE_IDPSP . "' OR type = '" . $eduroamDbType . "')";
249
+            $query .= " AND ( type = '".ExternalEduroamDBData::TYPE_IDPSP."' OR type = '".$eduroamDbType."')";
250 250
         }
251 251
         $externals = $this->db->exec($query, "s", $tld);
252 252
         // was a SELECT query, so a resource and not a boolean
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
      * @return array
308 308
      */
309 309
     
310
-    public function listExternalEntitiesByUserEmail($userEmail){
310
+    public function listExternalEntitiesByUserEmail($userEmail) {
311 311
         $out = [];
312 312
         $cat = $this->localDb->dbName;
313 313
         $query = "SELECT DISTINCT view_institution_admins.instid, $cat.institution.inst_id,
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
         
323 323
         $externals = $this->db->exec($query, 's', $userEmail);
324 324
         while ($row = $externals->fetch_array()) {
325
-            $external_db_id =  $row[0];
325
+            $external_db_id = $row[0];
326 326
             $inst_id = $row[1];
327 327
             $country = $row[2];
328 328
             $name = $row[3];
@@ -406,19 +406,19 @@  discard block
 block discarded – undo
406 406
      * 
407 407
      * @return array
408 408
      */
409
-    public function listExternalTlsServersInstitution($tld, $include_not_ready=FALSE) {
409
+    public function listExternalTlsServersInstitution($tld, $include_not_ready = FALSE) {
410 410
         $retval = [];
411 411
         // this includes servers of type "staging", which is fine
412 412
         $query = "SELECT ROid, instid, type, inst_name, servers, contacts, ts FROM view_tls_inst WHERE country = ?";
413 413
         if (!$include_not_ready) {
414
-            $query = $query . " AND servers IS NOT NULL AND contacts IS NOT NULL";
414
+            $query = $query." AND servers IS NOT NULL AND contacts IS NOT NULL";
415 415
         }
416 416
         $instServerTransaction = $this->db->exec($query, "s", $tld);
417 417
         while ($instServerResponses = mysqli_fetch_object(/** @scrutinizer ignore-type */ $instServerTransaction)) {
418 418
             $contactList = $this::dissectCollapsedContacts($instServerResponses->contacts);
419 419
             $names = $this->splitNames($instServerResponses->inst_name);
420 420
             $thelanguage = $names[$this->languageInstance->getLang()] ?? $names["en"] ?? array_shift($names);
421
-            $retval[$instServerResponses->ROid . "-". $instServerResponses->instid] = [
421
+            $retval[$instServerResponses->ROid."-".$instServerResponses->instid] = [
422 422
                 "names" => $names,
423 423
                 "name" => $thelanguage,
424 424
                 "type" => array_search($instServerResponses->type, self::TYPE_MAPPING),
Please login to merge, or discard this patch.
core/UserManagement.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                 } else {
161 161
                     $this->databaseHandle->exec("INSERT INTO ownership (user_id, institution_id, blesslevel, orig_mail) VALUES(?, ?, ?, ?)", "siss", $owner, $catId, $level, $destMail);
162 162
                 }
163
-                $this->loggerInstance->writeAudit((string) $owner, "OWN", "IdP " . $invitationDetails['cat_institution_id'] . " - added user as owner");
163
+                $this->loggerInstance->writeAudit((string) $owner, "OWN", "IdP ".$invitationDetails['cat_institution_id']." - added user as owner");
164 164
                 common\Entity::outOfThePotatoes();
165 165
                 return new IdP($invitationDetails['cat_institution_id']);
166 166
             }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
                 $idp = new IdP($fed->newIdP($invitationDetails['invite_fortype'], $owner, $invitationDetails['invite_issuer_level'], $invitationDetails['invite_dest_mail'], $bestnameguess));
175 175
                 $idp->addAttribute("general:instname", 'C', $bestnameguess);
176 176
             }
177
-            $this->loggerInstance->writeAudit($owner, "NEW", "IdP " . $idp->identifier . " - created from invitation");
177
+            $this->loggerInstance->writeAudit($owner, "NEW", "IdP ".$idp->identifier." - created from invitation");
178 178
 
179 179
             // in case we have more admins in the queue which were invited to 
180 180
             // administer the same inst but haven't redeemed their invitations 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
                              WHERE invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0 AND name = ? AND country = ? AND ( cat_institution_id IS NULL OR external_db_uniquehandle IS NULL ) ", "ss", $invitationDetails['name'], $invitationDetails['country']);
189 189
             // SELECT -> resource, no boolean
190 190
             while ($pendingDetail = mysqli_fetch_object(/** @scrutinizer ignore-type */ $otherPending)) {
191
-                $this->databaseHandle->exec("UPDATE invitations SET cat_institution_id = " . $idp->identifier . " WHERE id = " . $pendingDetail->id);
191
+                $this->databaseHandle->exec("UPDATE invitations SET cat_institution_id = ".$idp->identifier." WHERE id = ".$pendingDetail->id);
192 192
             }
193 193
             common\Entity::outOfThePotatoes();
194 194
             return $idp;
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
             'invite_dest_mail' => $_SESSION['auth_email']
214 214
         ];
215 215
         $idp = $this->newIdPFromExternal($extId, $fed, $invitationDetails, $owner, $externalinfo);
216
-        $this->loggerInstance->writeAudit($owner, "NEW", "IdP " . $idp->identifier . " - created from auto-registration of $extId");
216
+        $this->loggerInstance->writeAudit($owner, "NEW", "IdP ".$idp->identifier." - created from auto-registration of $extId");
217 217
         return $idp;
218 218
     }
219 219
     
@@ -339,9 +339,9 @@  discard block
 block discarded – undo
339 339
         $retval = [];
340 340
         $invitations = $this->databaseHandle->exec("SELECT cat_institution_id, country, name, invite_issuer_level, invite_dest_mail, invite_token , TIMESTAMPADD(DAY, 1, invite_created) as expiry
341 341
                                         FROM invitations 
342
-                                        WHERE cat_institution_id " . ( $idpIdentifier != 0 ? "= $idpIdentifier" : "IS NULL") . " AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0");
342
+                                        WHERE cat_institution_id " . ($idpIdentifier != 0 ? "= $idpIdentifier" : "IS NULL")." AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0");
343 343
         // SELECT -> resource, not boolean
344
-        $this->loggerInstance->debug(4, "Retrieving pending invitations for " . ($idpIdentifier != 0 ? "IdP $idpIdentifier" : "IdPs awaiting initial creation" ) . ".\n");
344
+        $this->loggerInstance->debug(4, "Retrieving pending invitations for ".($idpIdentifier != 0 ? "IdP $idpIdentifier" : "IdPs awaiting initial creation").".\n");
345 345
         while ($invitationQuery = mysqli_fetch_object(/** @scrutinizer ignore-type */ $invitations)) {
346 346
             $retval[] = ["country" => $invitationQuery->country, "name" => $invitationQuery->name, "mail" => $invitationQuery->invite_dest_mail, "token" => $invitationQuery->invite_token, "expiry" => $invitationQuery->expiry];
347 347
         }
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
         // these require not further checking
415 415
         foreach ($extInstListTmp as $country => $extInstCountryList) {
416 416
             $len = count($extInstCountryList);
417
-            for($i = 0; $i < $len; ++$i) {
417
+            for ($i = 0; $i < $len; ++$i) {
418 418
                 $extInst = $extInstCountryList[$i];
419 419
                 if ($extInst['inst_id'] != NULL && in_array($extInst['inst_id'], $this->currentInstitutions['existing'])) {
420 420
                     unset($extInstList[$country][$i]);
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
                     $names = $disectedNames['joint'];
455 455
                     $realms = \core\ExternalEduroamDBData::dissectCollapsedInstitutionRealms($extInst['realm']);
456 456
                     $foundMatch = $this->checkForSimilarInstitutions($names, $realms);
457
-                    $this->loggerInstance->debug(4, $foundMatch, "checkForSimilarInstitutions returned: ","\n");
457
+                    $this->loggerInstance->debug(4, $foundMatch, "checkForSimilarInstitutions returned: ", "\n");
458 458
                     if ($foundMatch == 0) {
459 459
                         $this->currentInstitutions['new'][] = [$extInst['external_db_id'], $disectedNames['perlang'], $country];
460 460
                     }
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
                 
463 463
             }    
464 464
         }
465
-        $this->loggerInstance->debug(4,$this->currentInstitutions['new'],"\n","\n");
465
+        $this->loggerInstance->debug(4, $this->currentInstitutions['new'], "\n", "\n");
466 466
         return $this->currentInstitutions;
467 467
     }
468 468
     
Please login to merge, or discard this patch.
core/ExternalNothing.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@
 block discarded – undo
133 133
      * @return array
134 134
      */
135 135
     
136
-    public function listExternalEntitiesByUserEmail($userEmail){
136
+    public function listExternalEntitiesByUserEmail($userEmail) {
137 137
         return [];
138 138
     }
139 139
 }
140 140
\ No newline at end of file
Please login to merge, or discard this patch.