| @@ -37,21 +37,21 @@ discard block | ||
| 37 | 37 |      { | 
| 38 | 38 | clearstatcache(); | 
| 39 | 39 | |
| 40 | -        if (! is_file($this->file)) { | |
| 40 | +        if (!is_file($this->file)) { | |
| 41 | 41 | event(new RotateIsNotNecessary($this->file, 'File '.$this->file.' does not exists')); | 
| 42 | 42 | |
| 43 | 43 | return false; | 
| 44 | 44 | } | 
| 45 | 45 | |
| 46 | -        if (! is_writable($this->file)) { | |
| 46 | +        if (!is_writable($this->file)) { | |
| 47 | 47 |              event(new RotateHasFailed($this->file, new Exception('File '.$this->file.' is not writable'))); | 
| 48 | 48 | |
| 49 | 49 | return false; | 
| 50 | 50 | } | 
| 51 | 51 | |
| 52 | -        if (! is_dir($this->dir_to_archive)) { | |
| 53 | -            if (! file_exists($this->dir_to_archive)) { | |
| 54 | -                if (! mkdir($this->dir_to_archive, 0777, true)) { | |
| 52 | +        if (!is_dir($this->dir_to_archive)) { | |
| 53 | +            if (!file_exists($this->dir_to_archive)) { | |
| 54 | +                if (!mkdir($this->dir_to_archive, 0777, true)) { | |
| 55 | 55 |                      event(new RotateHasFailed($this->file, new Exception('Directory '.$this->dir_to_archive.' to archive logs is not writable'))); | 
| 56 | 56 | |
| 57 | 57 | return false; | 
| @@ -63,7 +63,7 @@ discard block | ||
| 63 | 63 | } | 
| 64 | 64 | } | 
| 65 | 65 | |
| 66 | -        if (! is_writable($this->dir_to_archive)) { | |
| 66 | +        if (!is_writable($this->dir_to_archive)) { | |
| 67 | 67 |              event(new RotateHasFailed($this->file, new Exception('Directory '.$this->dir_to_archive.' to archive logs is not writable'))); | 
| 68 | 68 | |
| 69 | 69 | return false; | 
| @@ -92,23 +92,23 @@ discard block | ||
| 92 | 92 |      { | 
| 93 | 93 | $fdSource = fopen($fileSource, 'r+'); | 
| 94 | 94 | |
| 95 | -        if (! $fdSource) { | |
| 95 | +        if (!$fdSource) { | |
| 96 | 96 | return false; | 
| 97 | 97 | } | 
| 98 | 98 | |
| 99 | -        if (! flock($fdSource, LOCK_EX)) { | |
| 99 | +        if (!flock($fdSource, LOCK_EX)) { | |
| 100 | 100 | fclose($fdSource); | 
| 101 | 101 | |
| 102 | 102 | return false; | 
| 103 | 103 | } | 
| 104 | 104 | |
| 105 | -        if (! copy($fileSource, $fileDestination)) { | |
| 105 | +        if (!copy($fileSource, $fileDestination)) { | |
| 106 | 106 | fclose($fdSource); | 
| 107 | 107 | |
| 108 | 108 | return false; | 
| 109 | 109 | } | 
| 110 | 110 | |
| 111 | -        if (! ftruncate($fdSource, 0)) { | |
| 111 | +        if (!ftruncate($fdSource, 0)) { | |
| 112 | 112 | fclose($fdSource); | 
| 113 | 113 | |
| 114 | 114 | 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 | |
| @@ -75,7 +75,7 @@ discard block | ||
| 75 | 75 | |
| 76 | 76 | $glob = $fileInfo['dirname'].'/'.$fileInfo['filename']; | 
| 77 | 77 | |
| 78 | -        if (! empty($fileInfo['extension'])) { | |
| 78 | +        if (!empty($fileInfo['extension'])) { | |
| 79 | 79 | $glob .= '.'.$fileInfo['extension']; | 
| 80 | 80 | } | 
| 81 | 81 | |
| @@ -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 | |