Passed
Branch master (d19d3a)
by Tim
11:16
created
src/Aggregator.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function dumpConfig(): void
64 64
     {
65
-        echo 'Statistics directory   : ' . $this->statdir . "\n";
66
-        echo 'Input file             : ' . $this->inputfile . "\n";
67
-        echo 'Offset                 : ' . $this->offset . "\n";
65
+        echo 'Statistics directory   : '.$this->statdir."\n";
66
+        echo 'Input file             : '.$this->inputfile."\n";
67
+        echo 'Offset                 : '.$this->offset."\n";
68 68
     }
69 69
 
70 70
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     public function debugInfo(): void
74 74
     {
75 75
         // 1024*1024=1048576
76
-        echo 'Memory usage           : ' . number_format(memory_get_usage() / 1048576, 2) . " MB\n";
76
+        echo 'Memory usage           : '.number_format(memory_get_usage() / 1048576, 2)." MB\n";
77 77
     }
78 78
 
79 79
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      */
82 82
     public function loadMetadata(): void
83 83
     {
84
-        $filename = $this->statdir . '/.stat.metadata';
84
+        $filename = $this->statdir.'/.stat.metadata';
85 85
         $metadata = null;
86 86
         if (file_exists($filename)) {
87 87
             $metadata = unserialize(file_get_contents($filename));
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         $this->metadata['memory'] = memory_get_usage();
108 108
         $this->metadata['lastrun'] = time();
109 109
 
110
-        $filename = $this->statdir . '/.stat.metadata';
110
+        $filename = $this->statdir.'/.stat.metadata';
111 111
         file_put_contents($filename, serialize($this->metadata), LOCK_EX);
112 112
     }
113 113
 
@@ -122,17 +122,17 @@  discard block
 block discarded – undo
122 122
         $this->loadMetadata();
123 123
 
124 124
         if (!is_dir($this->statdir)) {
125
-            throw new Exception('Statistics module: output dir does not exist [' . $this->statdir . ']');
125
+            throw new Exception('Statistics module: output dir does not exist ['.$this->statdir.']');
126 126
         }
127 127
 
128 128
         if (!file_exists($this->inputfile)) {
129
-            throw new Exception('Statistics module: input file does not exist [' . $this->inputfile . ']');
129
+            throw new Exception('Statistics module: input file does not exist ['.$this->inputfile.']');
130 130
         }
131 131
 
132 132
         $file = fopen($this->inputfile, 'r');
133 133
 
134 134
         if ($file === false) {
135
-            throw new Exception('Statistics module: unable to open file [' . $this->inputfile . ']');
135
+            throw new Exception('Statistics module: unable to open file ['.$this->inputfile.']');
136 136
         }
137 137
 
138 138
         $logparser = new LogParser(
@@ -177,14 +177,14 @@  discard block
 block discarded – undo
177 177
             $action = trim($content[5]);
178 178
 
179 179
             if ($this->fromcmdline && ($i % 10000) == 0) {
180
-                echo "Read line " . $i . "\n";
180
+                echo "Read line ".$i."\n";
181 181
             }
182 182
 
183 183
             if ($debug) {
184 184
                 echo "----------------------------------------\n";
185
-                echo 'Log line: ' . $logline . "\n";
186
-                echo 'Date parse [' . substr($logline, 0, $this->statconfig->getOptionalValue('datelength', 15)) .
187
-                    '] to [' . date(DATE_RFC822, $epoch) . ']' . "\n";
185
+                echo 'Log line: '.$logline."\n";
186
+                echo 'Date parse ['.substr($logline, 0, $this->statconfig->getOptionalValue('datelength', 15)).
187
+                    '] to ['.date(DATE_RFC822, $epoch).']'."\n";
188 188
                 $ret = print_r($content, true);
189 189
                 echo htmlentities($ret);
190 190
                 if ($i >= 13) {
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
                         }
356 356
                     }
357 357
 
358
-                    $filename = $this->statdir . '/' . $rulename . '-' . $tres . '-' . $fileno . '.stat';
358
+                    $filename = $this->statdir.'/'.$rulename.'-'.$tres.'-'.$fileno.'.stat';
359 359
                     if (file_exists($filename)) {
360 360
                         $previousData = unserialize(file_get_contents($filename));
361 361
                         $filledresult = $this->cummulateData($previousData, $filledresult);
Please login to merge, or discard this patch.
src/StatDataset.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
         $timeresconfig = $timeresconfigs->getConfigItem($timeres);
75 75
         if ($timeresconfig === null) {
76
-            throw new Error\ConfigurationError('Missing \'timeres.' . $timeres . '\' in module configuration.');
76
+            throw new Error\ConfigurationError('Missing \'timeres.'.$timeres.'\' in module configuration.');
77 77
         }
78 78
 
79 79
         $this->timeresconfig = $timeresconfig;
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
                 'Statistics\FieldPresentation'
358 358
             );
359 359
             if (!class_exists($classname)) {
360
-                throw new Exception('Could not find field presentation plugin [' . $classname . ']: No class found');
360
+                throw new Exception('Could not find field presentation plugin ['.$classname.']: No class found');
361 361
             }
362 362
             $presentationHandler = new $classname($availdelimiters, $fieldpresConfig->getValue('config'), $t);
363 363
 
@@ -399,17 +399,17 @@  discard block
 block discarded – undo
399 399
         $rules = $this->ruleid;
400 400
         foreach ($rules as $rule) {
401 401
             // Get file and extract results.
402
-            $resultFileName = $statdir . '/' . $rule . '-' . $this->timeres . '-' . $this->fileslot . '.stat';
402
+            $resultFileName = $statdir.'/'.$rule.'-'.$this->timeres.'-'.$this->fileslot.'.stat';
403 403
             if (!file_exists($resultFileName)) {
404
-                throw new Exception('Aggregated statitics file [' . $resultFileName . '] not found.');
404
+                throw new Exception('Aggregated statitics file ['.$resultFileName.'] not found.');
405 405
             }
406 406
             if (!is_readable($resultFileName)) {
407
-                throw new Exception('Could not read statitics file [' . $resultFileName . ']. Bad file permissions?');
407
+                throw new Exception('Could not read statitics file ['.$resultFileName.']. Bad file permissions?');
408 408
             }
409 409
             $resultfile = file_get_contents($resultFileName);
410 410
             $newres = unserialize($resultfile);
411 411
             if (empty($newres)) {
412
-                throw new Exception('Aggregated statistics in file [' . $resultFileName . '] was empty.');
412
+                throw new Exception('Aggregated statistics in file ['.$resultFileName.'] was empty.');
413 413
             }
414 414
             $resarray[] = $newres;
415 415
         }
Please login to merge, or discard this patch.
config-templates/module_statistics.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     'statrules' => [
98 98
         'sloratio' => [
99 99
             'name'         => 'SLO to SSO ratio',
100
-            'descr'        => 'Comparison of the number of Single Log-Out compared to Single Sign-On.' .
100
+            'descr'        => 'Comparison of the number of Single Log-Out compared to Single Sign-On.'.
101 101
                 ' Graph shows how many logouts where initiated for each Single Sign-On.',
102 102
             'type'         => 'calculated',
103 103
             'presenter'    => 'statistics:Ratio',
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         ],
110 110
         'ssomulti' => [
111 111
             'name'         => 'Requests per session',
112
-            'descr'        => 'Number of SSO request pairs exchanged between IdP and SP within the same IdP session.' .
112
+            'descr'        => 'Number of SSO request pairs exchanged between IdP and SP within the same IdP session.'.
113 113
                 ' A high number indicates that the session at the SP is timing out faster than at the IdP.',
114 114
             'type'         => 'calculated',
115 115
             'presenter'    => 'statistics:Ratio',
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         ],
152 152
         'consent' => [
153 153
             'name'         => 'Consent',
154
-            'descr'        => 'Consent statistics. Every time a user logs in to a service an entry is logged for' .
154
+            'descr'        => 'Consent statistics. Every time a user logs in to a service an entry is logged for'.
155 155
                 ' one of three states: consent was found, consent was not found or consent storage was not available.',
156 156
             'action'       => 'consent',
157 157
             'col'          => 6,
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         ],
163 163
         'consentresponse' => [
164 164
             'name'         => 'Consent response',
165
-            'descr'        => 'Consent response statistics. Every time a user accepts consent,' .
165
+            'descr'        => 'Consent response statistics. Every time a user accepts consent,'.
166 166
                 ' it is logged whether the user selected to remember the consent to next time.',
167 167
             'action'       => 'consentResponse',
168 168
             'col'          => 6,
Please login to merge, or discard this patch.