@@ -2,6 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | use Cion\LaravelLogReader\Reader\LogReader; |
| 4 | 4 | |
| 5 | -Route::group(['prefix' => config('logreader.prefix', 'logreader'), 'middleware' => config('logreader.middleware', 'auth')], function () { |
|
| 5 | +Route::group(['prefix' => config('logreader.prefix', 'logreader'), 'middleware' => config('logreader.middleware', 'auth')], function() { |
|
| 6 | 6 | Route::get('/', 'Cion\LaravelLogReader\Reader\LogReaderController@index'); |
| 7 | 7 | }); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Cion\LaravelLogReader\Reader; |
| 5 | 5 | |
@@ -85,14 +85,14 @@ discard block |
||
| 85 | 85 | $this->extra->pop(); |
| 86 | 86 | $this->extra->pop(); |
| 87 | 87 | |
| 88 | - $this->extra = $this->extra->map(function ($extra) { |
|
| 88 | + $this->extra = $this->extra->map(function($extra) { |
|
| 89 | 89 | return explode(': ', substr($extra, 3)); |
| 90 | 90 | }); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | public function toArray() : array |
| 94 | 94 | { |
| 95 | - if (! $this->date || ! $this->type || ! $this->message || ! $this->extra) { |
|
| 95 | + if (!$this->date || !$this->type || !$this->message || !$this->extra) { |
|
| 96 | 96 | return []; |
| 97 | 97 | } |
| 98 | 98 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Cion\LaravelLogReader\Reader; |
| 5 | 5 | |
@@ -27,8 +27,8 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | $this->setTime(); |
| 29 | 29 | |
| 30 | - $this->getLogFiles()->each(function ($file) { |
|
| 31 | - $this->getFileLogSections($file)->each(function ($line) { |
|
| 30 | + $this->getLogFiles()->each(function($file) { |
|
| 31 | + $this->getFileLogSections($file)->each(function($line) { |
|
| 32 | 32 | $this->handleFileLine($line); |
| 33 | 33 | }); |
| 34 | 34 | }); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | { |
| 41 | 41 | $sectionReader = (new LogSectionReader($section))->read(); |
| 42 | 42 | |
| 43 | - if (! empty($sectionReader->toArray())) { |
|
| 43 | + if (!empty($sectionReader->toArray())) { |
|
| 44 | 44 | $this->loggers[] = $sectionReader->toArray(); |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | public function getLogFiles() : Collection |
| 59 | 59 | { |
| 60 | - if (! $this->filesystem->exists($this->getPath())) { |
|
| 60 | + if (!$this->filesystem->exists($this->getPath())) { |
|
| 61 | 61 | throw new FolderNotFoundException(); |
| 62 | 62 | } |
| 63 | 63 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | public function getFiles() : Collection |
| 68 | 68 | { |
| 69 | - return collect($this->files)->filter(function ($file) { |
|
| 69 | + return collect($this->files)->filter(function($file) { |
|
| 70 | 70 | if ($this->hasTime()) { |
| 71 | 71 | return $file->getFilename() === "laravel-{$this->getTime()}.log"; |
| 72 | 72 | } |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | public function getSubDirectoriesFiles() : LogReader |
| 79 | 79 | { |
| 80 | - collect($this->filesystem->directories($this->getPath()))->map(function ($directory) { |
|
| 81 | - collect($this->filesystem->files($directory))->filter(function ($file) { |
|
| 80 | + collect($this->filesystem->directories($this->getPath()))->map(function($directory) { |
|
| 81 | + collect($this->filesystem->files($directory))->filter(function($file) { |
|
| 82 | 82 | $this->files[] = $file; |
| 83 | 83 | }); |
| 84 | 84 | }); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | public function getDiretoryFiles() : LogReader |
| 90 | 90 | { |
| 91 | - collect($this->filesystem->files($this->getPath()))->filter(function ($file) { |
|
| 91 | + collect($this->filesystem->files($this->getPath()))->filter(function($file) { |
|
| 92 | 92 | $this->files[] = $file; |
| 93 | 93 | }); |
| 94 | 94 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | { |
| 159 | 159 | $sections = collect(); |
| 160 | 160 | |
| 161 | - collect(explode("\n", $content))->each(function ($line) use (&$sections) { |
|
| 161 | + collect(explode("\n", $content))->each(function($line) use (&$sections) { |
|
| 162 | 162 | if ((new LineHelper($line))->hasDate()) { |
| 163 | 163 | $sections->push([ |
| 164 | 164 | 'line' => $line, |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | { |
| 177 | 177 | $size = sizeof($sections); |
| 178 | 178 | |
| 179 | - return $sections->map(function ($value, $key) use ($size, $line) { |
|
| 179 | + return $sections->map(function($value, $key) use ($size, $line) { |
|
| 180 | 180 | if ($size - 1 === $key) { |
| 181 | 181 | $value['extra'][] = $line; |
| 182 | 182 | } |