Passed
Push — dev ( a02dd0...b83e75 )
by 世昌
02:23
created
suda/src/framework/debug/log/logger/FileLogger.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -91,14 +91,14 @@  discard block
 block discarded – undo
91 91
     {
92 92
         $unique = substr(md5(uniqid()), 0, 8);
93 93
         $save = $this->getConfig('save-path');
94
-        $this->tempName = $save . '/' . date('YmdHis') . '.' . $unique . '.log';
94
+        $this->tempName = $save.'/'.date('YmdHis').'.'.$unique.'.log';
95 95
         $temp = fopen($this->tempName, 'w+');
96 96
         if ($temp !== false) {
97 97
             $this->temp = $temp;
98 98
         } else {
99
-            throw new FileLoggerException(__METHOD__ . ':' . sprintf('cannot create log file'));
99
+            throw new FileLoggerException(__METHOD__.':'.sprintf('cannot create log file'));
100 100
         }
101
-        $this->latest = $save . '/' . $this->getConfig('file-name');
101
+        $this->latest = $save.'/'.$this->getConfig('file-name');
102 102
     }
103 103
 
104 104
     /**
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         $path = preg_replace(
127 127
             '/[\\\\]+/',
128 128
             '/',
129
-            $this->getConfig('save-zip-path') . '/' . date('Y-m-d') . '.zip'
129
+            $this->getConfig('save-zip-path').'/'.date('Y-m-d').'.zip'
130 130
         );
131 131
         $zip = $this->getZipArchive($path);
132 132
         if ($zip !== null) {
@@ -142,14 +142,14 @@  discard block
 block discarded – undo
142 142
      */
143 143
     private function zipFile(ZipArchive $zip, string $logFile)
144 144
     {
145
-        $add = $zip->addFile($logFile, date('Y-m-d') . '-' . $zip->numFiles . '.log');
145
+        $add = $zip->addFile($logFile, date('Y-m-d').'-'.$zip->numFiles.'.log');
146 146
         if (is_dir($this->getConfig('save-dump-path'))) {
147 147
             $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(
148 148
                 $this->getConfig('save-dump-path'),
149 149
                 RecursiveDirectoryIterator::SKIP_DOTS
150 150
             ));
151 151
             foreach ($it as $dumpLog) {
152
-                if ($zip->addFile($dumpLog, 'dump/' . basename($dumpLog))) {
152
+                if ($zip->addFile($dumpLog, 'dump/'.basename($dumpLog))) {
153 153
                     array_push($this->removeFiles, $dumpLog);
154 154
                 }
155 155
             }
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
             $this->safeMoveKeep(
170 170
                 $logFile,
171 171
                 $this->getConfig('save-path')
172
-                . '/' . date('Y-m-d')
173
-                . '-' . substr(md5(uniqid()), 0, 8) . '.log'
172
+                . '/'.date('Y-m-d')
173
+                . '-'.substr(md5(uniqid()), 0, 8).'.log'
174 174
             );
175 175
         }
176 176
     }
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
             $replace['%level%'] = $level;
261 261
             $replace['%message%'] = $message;
262 262
             $write = strtr($this->getConfig('log-format'), $replace);
263
-            fwrite($this->getAvailableWrite(), $write . PHP_EOL);
263
+            fwrite($this->getAvailableWrite(), $write.PHP_EOL);
264 264
         }
265 265
     }
266 266
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
             } elseif (null === $val) {
338 338
                 $val = 'null';
339 339
             }
340
-            $replace['{' . $key . '}'] = $val;
340
+            $replace['{'.$key.'}'] = $val;
341 341
         }
342 342
         return strtr($message, $replace);
343 343
     }
Please login to merge, or discard this patch.