Passed
Push — master ( 7e2c92...ce3375 )
by Tomasz
03:25
created
web/admin/sanity_tests.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     'mailer',
29 29
 ];
30 30
 
31
-if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == "LOCAL" || CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] == "LOCAL" ) {
31
+if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == "LOCAL" || CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] == "LOCAL") {
32 32
     $Tests[] = 'makensis';
33 33
     $Tests[] = 'makensis=>NSISmodules';
34 34
 }
Please login to merge, or discard this patch.
core/diag/Sociopath.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             2 => ["AREA" => AbstractTest::INFRA_DEVICE, 
63 63
                   "TXT" => _("Did the device previously work when roaming, i.e. at other hotspots away from your home institution?"), 
64 64
                   "FACTOR" => 0.33,
65
-                  "VERDICTLECTURE" => sprintf(_("If roaming consistently does not work, then very likely your device configuration is wrong. Typical errors causing this symptom include: using a routing ('outer') username without the @realm.tld suffix - those potentially work at home, but can not be used when roaming. %s"),$confAssistantText)],
65
+                  "VERDICTLECTURE" => sprintf(_("If roaming consistently does not work, then very likely your device configuration is wrong. Typical errors causing this symptom include: using a routing ('outer') username without the @realm.tld suffix - those potentially work at home, but can not be used when roaming. %s"), $confAssistantText)],
66 66
             3 => ["AREA" => AbstractTest::INFRA_DEVICE, 
67 67
                   "TXT" => _("Did you recently change the configuration on your device?"), 
68 68
                   "FACTOR" => 3,
@@ -100,12 +100,12 @@  discard block
 block discarded – undo
100 100
         $questionDetails = $this->qaArray[$questionNumber];
101 101
         if ($answer === TRUE) {
102 102
             $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] * $questionDetails["FACTOR"];
103
-            $this->loggerInstance->debug(3,"Adjusting ".$questionDetails['AREA']." by ".$questionDetails["FACTOR"]."\n");
103
+            $this->loggerInstance->debug(3, "Adjusting " . $questionDetails['AREA'] . " by " . $questionDetails["FACTOR"] . "\n");
104 104
             $factor = $questionDetails["FACTOR"];
105 105
         } elseif ($answer === FALSE) {
106 106
             $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] / $questionDetails["FACTOR"];
107
-            $this->loggerInstance->debug(3,"Adjusting ".$questionDetails['AREA']." by 1/".$questionDetails["FACTOR"]."\n");
108
-            $factor = 1/$questionDetails["FACTOR"];
107
+            $this->loggerInstance->debug(3, "Adjusting " . $questionDetails['AREA'] . " by 1/" . $questionDetails["FACTOR"] . "\n");
108
+            $factor = 1 / $questionDetails["FACTOR"];
109 109
         } else {
110 110
             $factor = 1;
111 111
         }
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
         $this->additionalFindings["QUESTIONSASKED"] = $this->previousQuestions;
115 115
         $_SESSION["SUSPECTS"] = $this->possibleFailureReasons;
116 116
         $_SESSION["EVIDENCE"] = $this->additionalFindings;
117
-        $this->loggerInstance->debug(3,$_SESSION['SUSPECTS']);
118
-        $this->loggerInstance->debug(3,$_SESSION['EVIDENCE']);
117
+        $this->loggerInstance->debug(3, $_SESSION['SUSPECTS']);
118
+        $this->loggerInstance->debug(3, $_SESSION['EVIDENCE']);
119 119
     }
120 120
     
121 121
     /**
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         // if both are identical, take any of the questions in the pool of both
135 135
         foreach ($this->qaArray as $questionNumber => $questionDetails) {
136 136
             // if we find a question we didn't ask before AND it is related to our currently high-scoring problem area, ask it
137
-            if (!array_key_exists($questionNumber, $this->previousQuestions) && ( $questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory) ) {
137
+            if (!array_key_exists($questionNumber, $this->previousQuestions) && ($questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory)) {
138 138
                 return json_encode(["NEXTEXISTS" => TRUE, "NUMBER" => $questionNumber, "TEXT" => $questionDetails["TXT"]]);
139 139
             }
140 140
         }
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
      * @return string JSON encoded array with all the info we have
148 148
      */
149 149
     public function getCurrentGuessState() {
150
-        return json_encode([ "SUSPECTS" => $this->possibleFailureReasons, "EVIDENCE" => $this->additionalFindings ]);
150
+        return json_encode(["SUSPECTS" => $this->possibleFailureReasons, "EVIDENCE" => $this->additionalFindings]);
151 151
     }
152 152
     
153 153
     /**
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         $text = $this->genericVerdictTexts[$area];
160 160
         foreach ($this->previousQuestions as $number => $factor) {
161 161
             if ($this->qaArray[$number]["AREA"] == $area && $factor > 1) {
162
-                $text .= "\n\n".$this->qaArray[$number]["VERDICTLECTURE"];
162
+                $text .= "\n\n" . $this->qaArray[$number]["VERDICTLECTURE"];
163 163
             }
164 164
         }
165 165
         return $text;
Please login to merge, or discard this patch.
web/admin/112365365321.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
                     <th>Device</th>
119 119
                     <th>Admin Downloads</th>
120 120
                     <th>User Downloads (classic)</th>
121
-                    <th>User Downloads (<?php echo \core\ProfileSilverbullet::PRODUCTNAME;?>)</th>
121
+                    <th>User Downloads (<?php echo \core\ProfileSilverbullet::PRODUCTNAME; ?>)</th>
122 122
                     <th>User Downloads (total)</th>
123 123
                 </tr>
124 124
                 <?php
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                     $admin_query = $dbHandle->exec("SELECT SUM(downloads_admin) AS admin, SUM(downloads_user) AS user, SUM(downloads_silverbullet) as silverbullet FROM downloads WHERE device_id = '$index'");
131 131
                     // SELECT -> mysqli_result, not boolean
132 132
                     while ($a = mysqli_fetch_object(/** @scrutinizer ignore-type */ $admin_query)) {
133
-                        echo "<td>" . $device_array['display'] . "</td><td>" . $a->admin . "</td><td>" . $a->user . "</td><td>" . $a->silverbullet . "</td><td>" . sprintf("%s",$a->user + $a->silverbullet) . "</td>";
133
+                        echo "<td>" . $device_array['display'] . "</td><td>" . $a->admin . "</td><td>" . $a->user . "</td><td>" . $a->silverbullet . "</td><td>" . sprintf("%s", $a->user + $a->silverbullet) . "</td>";
134 134
                         $gross_admin = $gross_admin + $a->admin;
135 135
                         $gross_user = $gross_user + $a->user;
136 136
                         $gross_silverbullet = $gross_silverbullet + $a->silverbullet;
Please login to merge, or discard this patch.
utils/ocsp_update.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,16 +30,16 @@
 block discarded – undo
30 30
   * destination.
31 31
   */
32 32
 
33
-$tempdir = __DIR__."/temp_ocsp";
33
+$tempdir = __DIR__ . "/temp_ocsp";
34 34
 mkdir($tempdir);
35 35
 
36 36
 $allStatements = $dbLink->exec("SELECT serial_number,OCSP FROM silverbullet_certificate WHERE serial_number IS NOT NULL AND expiry > NOW() AND OCSP_timestamp > DATE_SUB(NOW(), INTERVAL 8 DAY)");
37 37
 // SELECT -> mysqli_result, not boolean
38 38
 while ($statementRow = mysqli_fetch_object(/** @scrutinizer ignore-type */ $allStatements)) {
39 39
 #    echo "Writing OCSP statement for serial number $statementRow->serial_number\n";
40
-    $filename = strtoupper(dechex($statementRow->serial_number)).".der";
40
+    $filename = strtoupper(dechex($statementRow->serial_number)) . ".der";
41 41
     if (strlen($filename) % 2 == 1) {
42 42
         $filename = "0" . $filename;
43 43
     }
44
-    file_put_contents($tempdir."/$filename", $statementRow->OCSP);
44
+    file_put_contents($tempdir . "/$filename", $statementRow->OCSP);
45 45
 }
Please login to merge, or discard this patch.
core/EntityWithDBProperties.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
             case "core\User":
115 115
                 return $this->userName;
116 116
             default:
117
-                throw new Exception("Operating on a class where we don't know the relevant identifier in the DB - ".get_class($this)."!");
117
+                throw new Exception("Operating on a class where we don't know the relevant identifier in the DB - " . get_class($this) . "!");
118 118
         }
119 119
     }
120 120
     
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
         $handle = DBConnection::handle("INST");
246 246
         $blobQuery = $handle->exec("SELECT option_value from $table WHERE row = $row");
247 247
         // SELECT -> returns resource, not boolean
248
-        while ($returnedData =  /** @scrutinizer ignore-type */ mysqli_fetch_object($blobQuery)) {
248
+        while ($returnedData = /** @scrutinizer ignore-type */ mysqli_fetch_object($blobQuery)) {
249 249
             $blob = $returnedData->option_value;
250 250
         }
251 251
         if (!isset($blob)) {
Please login to merge, or discard this patch.
core/UserAPI.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -549,7 +549,7 @@
 block discarded – undo
549 549
             if (count($logoAttribute) == 0) {
550 550
                 return(NULL);
551 551
             }
552
-            $this->loggerInstance->debug(4,"RESIZE:$width:$height\n");
552
+            $this->loggerInstance->debug(4, "RESIZE:$width:$height\n");
553 553
             $meta = $this->processImage($logoAttribute[0]['value'], $logoFile, $width, $height, $resize);
554 554
             $filetype = $meta['filetype'];
555 555
             $expiresString = $meta['expires'];
Please login to merge, or discard this patch.
devices/test_module/Device_TestModule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@
 block discarded – undo
124 124
      * @return string
125 125
      */
126 126
     private function zipInstaller($attr) {
127
-        if (count($attr)==0) {
127
+        if (count($attr) == 0) {
128 128
             // never mind, just checking. You CAN use the $attr array to extract
129 129
             // information about the IdP/Profile if there's a need
130 130
         }
Please login to merge, or discard this patch.
core/DeviceConfig.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -103,9 +103,9 @@  discard block
 block discarded – undo
103 103
         $dummy_inst2 = _("organisation");
104 104
         // and do something useless with the strings so that there's no "unused" complaint
105 105
         // by Scrutinizer
106
-        if( $dummy_NRO . $dummy_inst1 . $dummy_inst2 == "") {
106
+        if ($dummy_NRO . $dummy_inst1 . $dummy_inst2 == "") {
107 107
             // oh well.
108
-            explode(' ',$dummy_NRO);
108
+            explode(' ', $dummy_NRO);
109 109
         }
110 110
 
111 111
         $this->nomenclature_fed = _(CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_federation']);
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         }
215 215
         if (isset($this->attributes['general:logo_file'])) {
216 216
             $this->loggerInstance->debug(5, "saving IDP logo\n");
217
-            $this->attributes['internal:logo_file'] = $this->saveLogoFile($this->attributes['general:logo_file'],'idp');
217
+            $this->attributes['internal:logo_file'] = $this->saveLogoFile($this->attributes['general:logo_file'], 'idp');
218 218
         }
219 219
         if (isset($this->attributes['fed:logo_file'])) {
220 220
             $this->loggerInstance->debug(5, "saving FED logo\n");
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
      * @return array list of filenames and the mime types
587 587
      * @throws Exception
588 588
      */
589
-    private function saveLogoFile($logos,$type) {
589
+    private function saveLogoFile($logos, $type) {
590 590
         $iterator = 0;
591 591
         $returnarray = [];
592 592
         foreach ($logos as $blob) {
Please login to merge, or discard this patch.
web/skins/example/accountstatus.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,12 +8,12 @@
 block discarded – undo
8 8
  *******************************************************************************
9 9
  */
10 10
 ?>
11
-<h1>Example Skin (Pick-Up and Status page for <?php echo \core\ProfileSilverbullet::PRODUCTNAME;?>)</h1>
12
-<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES","consortium_logo.png");?>"/>
11
+<h1>Example Skin (Pick-Up and Status page for <?php echo \core\ProfileSilverbullet::PRODUCTNAME; ?>)</h1>
12
+<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES", "consortium_logo.png"); ?>"/>
13 13
 <p>This skin is much more sober and less bloated than the default one. As it happens, it also doesn't do anything.</p>
14 14
 <p>But at least it goes to show that it's possible to include custom images/CSS/external software using findResourceUrl(..., $filename):
15
-<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES","custom.png");?>"/>
16
-<p>For <?php echo \core\ProfileSilverbullet::PRODUCTNAME;?>, this page can make use of the request status info we have collected prior to invocation of the skinned page:</p>
15
+<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES", "custom.png"); ?>"/>
16
+<p>For <?php echo \core\ProfileSilverbullet::PRODUCTNAME; ?>, this page can make use of the request status info we have collected prior to invocation of the skinned page:</p>
17 17
 <pre>
18
-    <?php print_r($statusInfo);?>
18
+    <?php print_r($statusInfo); ?>
19 19
 </pre>
Please login to merge, or discard this patch.