Passed
Push — dev ( 704976...a02dd0 )
by 世昌
02:38
created
suda/src/framework/debug/log/logger/FileLogger.php 1 patch
Spacing   +11 added lines, -11 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,18 +126,18 @@  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) {
133
-            $add = $zip->addFile($logFile, date('Y-m-d') . '-' . $zip->numFiles . '.log');
133
+            $add = $zip->addFile($logFile, date('Y-m-d').'-'.$zip->numFiles.'.log');
134 134
             if (is_dir($this->getConfig('save-dump-path'))) {
135 135
                 $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(
136 136
                     $this->getConfig('save-dump-path'),
137 137
                     RecursiveDirectoryIterator::SKIP_DOTS
138 138
                 ));
139 139
                 foreach ($it as $dumpLog) {
140
-                    if ($zip->addFile($dumpLog, 'dump/' . basename($dumpLog))) {
140
+                    if ($zip->addFile($dumpLog, 'dump/'.basename($dumpLog))) {
141 141
                         array_push($this->removeFiles, $dumpLog);
142 142
                     }
143 143
                 }
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
                 $this->safeMoveKeep(
152 152
                     $logFile,
153 153
                     $this->getConfig('save-path')
154
-                    . '/' . date('Y-m-d')
155
-                    . '-' . substr(md5(uniqid()), 0, 8). '.log'
154
+                    . '/'.date('Y-m-d')
155
+                    . '-'.substr(md5(uniqid()), 0, 8).'.log'
156 156
                 );
157 157
             }
158 158
         }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
     {
167 167
         $fromFile = fopen($from, 'r');
168 168
         $toFile = fopen($to, 'w+');
169
-        if ($fromFile !== false  && $toFile !== false) {
169
+        if ($fromFile !== false && $toFile !== false) {
170 170
             flock($toFile, LOCK_EX);
171 171
             // 复制内容
172 172
             stream_copy_to_stream($fromFile, $toFile);
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
             $replace['%level%'] = $level;
244 244
             $replace['%message%'] = $message;
245 245
             $write = strtr($this->getConfig('log-format'), $replace);
246
-            fwrite($this->getAvailableWrite(), $write . PHP_EOL);
246
+            fwrite($this->getAvailableWrite(), $write.PHP_EOL);
247 247
         }
248 248
     }
249 249
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
             } elseif (null === $val) {
321 321
                 $val = 'null';
322 322
             }
323
-            $replace['{' . $key . '}'] = $val;
323
+            $replace['{'.$key.'}'] = $val;
324 324
         }
325 325
         return strtr($message, $replace);
326 326
     }
Please login to merge, or discard this patch.