@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $files = []; |
| 31 | 31 | |
| 32 | 32 | foreach (self::getHandlers() as $handler) { |
| 33 | - if ($handler instanceof StreamHandler && ! $handler instanceof RotatingFileHandler) { |
|
| 33 | + if ($handler instanceof StreamHandler && !$handler instanceof RotatingFileHandler) { |
|
| 34 | 34 | $files[] = $handler->getUrl(); |
| 35 | 35 | } |
| 36 | 36 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | public static function closeHandlers() |
| 42 | 42 | { |
| 43 | 43 | foreach (self::getHandlers() as $handler) { |
| 44 | - if ($handler instanceof StreamHandler && ! $handler instanceof RotatingFileHandler) { |
|
| 44 | + if ($handler instanceof StreamHandler && !$handler instanceof RotatingFileHandler) { |
|
| 45 | 45 | if (method_exists($handler, 'close')) { |
| 46 | 46 | $handler->close(); |
| 47 | 47 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | ]); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - $this->app->booted(function () { |
|
| 28 | + $this->app->booted(function() { |
|
| 29 | 29 | if (config('rotate.schedule.enable', true)) { |
| 30 | 30 | $schedule = $this->app->make(Schedule::class); |
| 31 | 31 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | private function validateFile(): bool |
| 44 | 44 | { |
| 45 | - if (! is_file($this->file)) { |
|
| 45 | + if (!is_file($this->file)) { |
|
| 46 | 46 | event(new RotateIsNotNecessary($this->file, 'File '.$this->file.' does not exists')); |
| 47 | 47 | |
| 48 | 48 | return false; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | return false; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - if (! is_writable($this->file)) { |
|
| 57 | + if (!is_writable($this->file)) { |
|
| 58 | 58 | event(new RotateHasFailed($this->file, new Exception('File '.$this->file.' is not writable'))); |
| 59 | 59 | |
| 60 | 60 | return false; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | private function validateDirectory(): bool |
| 67 | 67 | { |
| 68 | 68 | if (is_dir($this->dir_to_archive)) { |
| 69 | - if (! is_writable($this->dir_to_archive)) { |
|
| 69 | + if (!is_writable($this->dir_to_archive)) { |
|
| 70 | 70 | event(new RotateHasFailed($this->file, new Exception('Directory '.$this->dir_to_archive.' to archive logs is not writable'))); |
| 71 | 71 | |
| 72 | 72 | return false; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | return false; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - if (! mkdir($this->dir_to_archive, 0777, true)) { |
|
| 84 | + if (!mkdir($this->dir_to_archive, 0777, true)) { |
|
| 85 | 85 | event(new RotateHasFailed($this->file, new Exception('Directory '.$this->dir_to_archive.' to archive logs is not writable'))); |
| 86 | 86 | |
| 87 | 87 | return false; |
@@ -104,23 +104,23 @@ discard block |
||
| 104 | 104 | { |
| 105 | 105 | $fdSource = fopen($fileSource, 'r+'); |
| 106 | 106 | |
| 107 | - if (! $fdSource) { |
|
| 107 | + if (!$fdSource) { |
|
| 108 | 108 | return false; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - if (! flock($fdSource, LOCK_EX)) { |
|
| 111 | + if (!flock($fdSource, LOCK_EX)) { |
|
| 112 | 112 | fclose($fdSource); |
| 113 | 113 | |
| 114 | 114 | return false; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - if (! copy($fileSource, $fileDestination)) { |
|
| 117 | + if (!copy($fileSource, $fileDestination)) { |
|
| 118 | 118 | fclose($fdSource); |
| 119 | 119 | |
| 120 | 120 | return false; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - if (! ftruncate($fdSource, 0)) { |
|
| 123 | + if (!ftruncate($fdSource, 0)) { |
|
| 124 | 124 | fclose($fdSource); |
| 125 | 125 | |
| 126 | 126 | unlink($fileDestination); |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | public function run() |
| 22 | 22 | { |
| 23 | - if (! $this->validate()) { |
|
| 23 | + if (!$this->validate()) { |
|
| 24 | 24 | return false; |
| 25 | 25 | } |
| 26 | 26 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | if ($fd_tmp) { |
| 54 | 54 | $fd_compress = gzopen($this->file_rotated, 'w'); |
| 55 | 55 | |
| 56 | - while (! feof($fd_tmp)) { |
|
| 56 | + while (!feof($fd_tmp)) { |
|
| 57 | 57 | gzwrite($fd_compress, fread($fd_tmp, 1024 * 512)); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | { |
| 95 | 95 | $patternGlob = $fileInfo['dirname'].'/'.$fileInfo['filename']; |
| 96 | 96 | |
| 97 | - if (! empty($fileInfo['extension'])) { |
|
| 97 | + if (!empty($fileInfo['extension'])) { |
|
| 98 | 98 | $patternGlob .= '.'.$fileInfo['extension']; |
| 99 | 99 | } |
| 100 | 100 | |