@@ -3,7 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use WebStream\DI\Injector; |
5 | 5 | use WebStream\IO\File; |
6 | -use WebStream\IO\FileInputStream; |
|
7 | 6 | use WebStream\IO\Reader\FileReader; |
8 | 7 | use WebStream\IO\Writer\SimpleFileWriter; |
9 | 8 | use WebStream\Module\Utility\LoggerUtils; |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | |
76 | 76 | $this->ioContainer = new Container(); |
77 | 77 | |
78 | - $this->ioContainer->statusReader = function () use ($statusFile) { |
|
78 | + $this->ioContainer->statusReader = function() use ($statusFile) { |
|
79 | 79 | return new FileReader($statusFile); |
80 | 80 | }; |
81 | - $this->ioContainer->statusWriter = function () use ($statusFile) { |
|
81 | + $this->ioContainer->statusWriter = function() use ($statusFile) { |
|
82 | 82 | return new SimpleFileWriter($statusFile->getFilePath()); |
83 | 83 | }; |
84 | - $this->ioContainer->logWriter = function () use ($logFile) { |
|
84 | + $this->ioContainer->logWriter = function() use ($logFile) { |
|
85 | 85 | return new SimpleFileWriter($logFile->getFilePath()); |
86 | 86 | }; |
87 | 87 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | date_default_timezone_set('Asia/Tokyo'); |
203 | 203 | $msec = sprintf("%2d", floatval(microtime()) * 100); |
204 | 204 | |
205 | - return strftime("%Y-%m-%d %H:%M:%S") . "," . $msec; |
|
205 | + return strftime("%Y-%m-%d %H:%M:%S").",".$msec; |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | /** |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | $outputter->write(self::$formatter->getFormattedMessage($msg, $level)); |
241 | 241 | } |
242 | 242 | } else { |
243 | - $this->ioContainer->logWriter->write(self::$formatter->getFormattedMessage($msg, $level) . PHP_EOL); |
|
243 | + $this->ioContainer->logWriter->write(self::$formatter->getFormattedMessage($msg, $level).PHP_EOL); |
|
244 | 244 | } |
245 | 245 | } catch (LoggerException $e) { |
246 | 246 | throw $e; |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | { |
288 | 288 | $content = $this->ioContainer->statusReader->read(); |
289 | 289 | if (!preg_match('/^\d{10}$/', $content)) { |
290 | - throw new LoggerException("Invalid log state file contents: " . $content); |
|
290 | + throw new LoggerException("Invalid log state file contents: ".$content); |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | return intval($content); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | while (@is_link($filePath)) { |
85 | 85 | $linkPath = readlink($filePath); |
86 | 86 | if ($linkPath === false) { |
87 | - throw new IOException("Symbolic link read error: " . $filePath); |
|
87 | + throw new IOException("Symbolic link read error: ".$filePath); |
|
88 | 88 | } |
89 | 89 | $filePath = $linkPath; |
90 | 90 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $length = filesize($filePath); |
180 | 180 | |
181 | 181 | if ($length === false) { |
182 | - throw new IOException("Cannot get filesize of " . $filePath); |
|
182 | + throw new IOException("Cannot get filesize of ".$filePath); |
|
183 | 183 | } |
184 | 184 | } |
185 | 185 | |
@@ -229,10 +229,10 @@ discard block |
||
229 | 229 | $dirname = dirname($destPath); |
230 | 230 | $dir = new File($dirname); |
231 | 231 | if (!$dir->isWritable()) { |
232 | - throw new IOException("Cannot writable: " . $destPath); |
|
232 | + throw new IOException("Cannot writable: ".$destPath); |
|
233 | 233 | } |
234 | 234 | $dirPath = $dir->getFilePath(); |
235 | - $absDestPath = $dirPath . "/" . basename($destPath); |
|
235 | + $absDestPath = $dirPath."/".basename($destPath); |
|
236 | 236 | |
237 | 237 | return rename($this->filePath, $absDestPath); |
238 | 238 | } |