Passed
Push — master ( 0b8b91...ca50ab )
by Tim
08:16
created
lib/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.
lib/Aggregator.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
      */
65 65
     public function dumpConfig(): void
66 66
     {
67
-        echo 'Statistics directory   : ' . $this->statdir . "\n";
68
-        echo 'Input file             : ' . $this->inputfile . "\n";
69
-        echo 'Offset                 : ' . $this->offset . "\n";
67
+        echo 'Statistics directory   : '.$this->statdir."\n";
68
+        echo 'Input file             : '.$this->inputfile."\n";
69
+        echo 'Offset                 : '.$this->offset."\n";
70 70
     }
71 71
 
72 72
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     public function debugInfo(): void
77 77
     {
78 78
         // 1024*1024=1048576
79
-        echo 'Memory usage           : ' . number_format(memory_get_usage() / 1048576, 2) . " MB\n";
79
+        echo 'Memory usage           : '.number_format(memory_get_usage() / 1048576, 2)." MB\n";
80 80
     }
81 81
 
82 82
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public function loadMetadata(): void
87 87
     {
88
-        $filename = $this->statdir . '/.stat.metadata';
88
+        $filename = $this->statdir.'/.stat.metadata';
89 89
         $metadata = null;
90 90
         if (file_exists($filename)) {
91 91
             $metadata = unserialize(file_get_contents($filename));
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         $this->metadata['memory'] = memory_get_usage();
113 113
         $this->metadata['lastrun'] = time();
114 114
 
115
-        $filename = $this->statdir . '/.stat.metadata';
115
+        $filename = $this->statdir.'/.stat.metadata';
116 116
         file_put_contents($filename, serialize($this->metadata), LOCK_EX);
117 117
     }
118 118
 
@@ -127,17 +127,17 @@  discard block
 block discarded – undo
127 127
         $this->loadMetadata();
128 128
 
129 129
         if (!is_dir($this->statdir)) {
130
-            throw new Exception('Statistics module: output dir does not exist [' . $this->statdir . ']');
130
+            throw new Exception('Statistics module: output dir does not exist ['.$this->statdir.']');
131 131
         }
132 132
 
133 133
         if (!file_exists($this->inputfile)) {
134
-            throw new Exception('Statistics module: input file does not exist [' . $this->inputfile . ']');
134
+            throw new Exception('Statistics module: input file does not exist ['.$this->inputfile.']');
135 135
         }
136 136
 
137 137
         $file = fopen($this->inputfile, 'r');
138 138
 
139 139
         if ($file === false) {
140
-            throw new Exception('Statistics module: unable to open file [' . $this->inputfile . ']');
140
+            throw new Exception('Statistics module: unable to open file ['.$this->inputfile.']');
141 141
         }
142 142
 
143 143
         $logparser = new LogParser(
@@ -182,14 +182,14 @@  discard block
 block discarded – undo
182 182
             $action = trim($content[5]);
183 183
 
184 184
             if ($this->fromcmdline && ($i % 10000) == 0) {
185
-                echo "Read line " . $i . "\n";
185
+                echo "Read line ".$i."\n";
186 186
             }
187 187
 
188 188
             if ($debug) {
189 189
                 echo "----------------------------------------\n";
190
-                echo 'Log line: ' . $logline . "\n";
191
-                echo 'Date parse [' . substr($logline, 0, $this->statconfig->getValue('datelength', 15)) .
192
-                    '] to [' . date(DATE_RFC822, $epoch) . ']' . "\n";
190
+                echo 'Log line: '.$logline."\n";
191
+                echo 'Date parse ['.substr($logline, 0, $this->statconfig->getValue('datelength', 15)).
192
+                    '] to ['.date(DATE_RFC822, $epoch).']'."\n";
193 193
                 $ret = print_r($content, true);
194 194
                 echo htmlentities($ret);
195 195
                 if ($i >= 13) {
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
                         }
362 362
                     }
363 363
 
364
-                    $filename = $this->statdir . '/' . $rulename . '-' . $tres . '-' . $fileno . '.stat';
364
+                    $filename = $this->statdir.'/'.$rulename.'-'.$tres.'-'.$fileno.'.stat';
365 365
                     if (file_exists($filename)) {
366 366
                         $previousData = unserialize(file_get_contents($filename));
367 367
                         $filledresult = $this->cummulateData($previousData, $filledresult);
Please login to merge, or discard this patch.
lib/LogCleaner.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public function dumpConfig(): void
54 54
     {
55
-        echo 'Statistics directory   : ' . $this->statdir . "\n";
56
-        echo 'Input file             : ' . $this->inputfile . "\n";
57
-        echo 'Offset                 : ' . $this->offset . "\n";
55
+        echo 'Statistics directory   : '.$this->statdir."\n";
56
+        echo 'Input file             : '.$this->inputfile."\n";
57
+        echo 'Offset                 : '.$this->offset."\n";
58 58
     }
59 59
 
60 60
 
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
     public function clean(bool $debug = false): array
67 67
     {
68 68
         if (!is_dir($this->statdir)) {
69
-            throw new Exception('Statistics module: output dir do not exists [' . $this->statdir . ']');
69
+            throw new Exception('Statistics module: output dir do not exists ['.$this->statdir.']');
70 70
         }
71 71
 
72 72
         if (!file_exists($this->inputfile)) {
73
-            throw new Exception('Statistics module: input file do not exists [' . $this->inputfile . ']');
73
+            throw new Exception('Statistics module: input file do not exists ['.$this->inputfile.']');
74 74
         }
75 75
 
76 76
         $file = fopen($this->inputfile, 'r');
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             $content = $logparser->parseContent($logline);
100 100
 
101 101
             if (($i % 10000) == 0) {
102
-                echo "Read line " . $i . "\n";
102
+                echo "Read line ".$i."\n";
103 103
             }
104 104
 
105 105
             $trackid = $content[4];
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
 
112 112
             if ($debug) {
113 113
                 echo "----------------------------------------\n";
114
-                echo 'Log line: ' . $logline . "\n";
115
-                echo 'Date parse [' . substr($logline, 0, $this->statconfig->getValue('datelength', 15)) .
116
-                    '] to [' . date(DATE_RFC822, $epoch) . ']' . "\n";
114
+                echo 'Log line: '.$logline."\n";
115
+                echo 'Date parse ['.substr($logline, 0, $this->statconfig->getValue('datelength', 15)).
116
+                    '] to ['.date(DATE_RFC822, $epoch).']'."\n";
117 117
                 $ret = print_r($content, true);
118 118
                 echo htmlentities($ret);
119 119
                 if ($i >= 13) {
@@ -150,14 +150,14 @@  discard block
 block discarded – undo
150 150
      */
151 151
     public function store(array $todelete, string $outputfile): void
152 152
     {
153
-        echo "Preparing to delete [" . count($todelete) . "] trackids\n";
153
+        echo "Preparing to delete [".count($todelete)."] trackids\n";
154 154
 
155 155
         if (!is_dir($this->statdir)) {
156
-            throw new Exception('Statistics module: output dir do not exists [' . $this->statdir . ']');
156
+            throw new Exception('Statistics module: output dir do not exists ['.$this->statdir.']');
157 157
         }
158 158
 
159 159
         if (!file_exists($this->inputfile)) {
160
-            throw new Exception('Statistics module: input file do not exists [' . $this->inputfile . ']');
160
+            throw new Exception('Statistics module: input file do not exists ['.$this->inputfile.']');
161 161
         }
162 162
 
163 163
         $file = fopen($this->inputfile, 'r');
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
             $content = $logparser->parseContent($logline);
190 190
 
191 191
             if (($i % 10000) == 0) {
192
-                echo "Read line " . $i . "\n";
192
+                echo "Read line ".$i."\n";
193 193
             }
194 194
 
195 195
             $trackid = $content[4];
Please login to merge, or discard this patch.