src/Reader/LineReader.phpmodified+6-6Changes to src/Reader/LineReader.php | @@ -17,7 +17,7 @@ class LineReader |
| 17 | 17 | 'ERROR', |
| 18 | 18 | 'WARNING', |
| 19 | 19 | 'NOTICE', |
| 20 | | - 'INFO' |
| 20 | + 'INFO', |
| 21 | 21 | ]; |
| 22 | 22 | |
| 23 | 23 | public $type; |
formatting only · 8 hidden lines
Changes to src/Reader/LineReader.php | @@ -32,7 +32,7 @@ class LineReader formatting only |
| 32 | 32 | { |
| 33 | 33 | $this->line = $line; |
| 34 | 34 | |
| 35 | | - if(request()->filled('logreader_type') && request('logreader_type') !== 'all') { |
| 35 | + if (request()->filled('logreader_type') && request('logreader_type') !== 'all') { |
| 36 | 36 | $this->types = [strtoupper(request()->logreader_type)]; |
| 37 | 37 | } |
| 38 | 38 | } |
Changes to src/Reader/LineReader.php | @@ -51,9 +51,9 @@ class LineReader |
| 51 | 51 | public function getArray() |
| 52 | 52 | { |
| 53 | 53 | return [ |
| 54 | | - "date" => $this->date, |
| 55 | | - "type" => $this->type, |
| 56 | | - "message" => $this->message |
| 54 | + 'date' => $this->date, |
| 55 | + 'type' => $this->type, |
| 56 | + 'message' => $this->message, |
| 57 | 57 | ]; |
| 58 | 58 | } |
| 59 | 59 | |
| @@ -88,7 +88,7 @@ class LineReader |
| 88 | 88 | |
| 89 | 89 | public function retrieveMessage() |
| 90 | 90 | { |
| 91 | | - $this->message = Str::replaceFirst(config('logreader.env').'.'.$this->type.": ", '', $this->LineWithoutDate()); |
| 91 | + $this->message = Str::replaceFirst(config('logreader.env').'.'.$this->type.': ', '', $this->LineWithoutDate()); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | public function hasLoggerType($type) |
src/Reader/LogReader.phpmodifiedformatting only+0-1Changes to src/Reader/LogReader.php | @@ -69,7 +69,6 @@ class LogReader |
| 69 | 69 | return $this; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | | - |
| 73 | 72 | public function yesterday() |
| 74 | 73 | { |
| 75 | 74 | $this->time = now()->subDay()->format('Y-m-d'); |
src/ServiceProvider.phpmodified+1-1Changes to src/ServiceProvider.php | @@ -13,7 +13,7 @@ class ServiceProvider extends BaseServiceProvider |
| 13 | 13 | $this->loadRoutesFrom(__DIR__.'/routes.php'); |
| 14 | 14 | |
| 15 | 15 | $this->publishes([ |
| 16 | | - __DIR__.'/config.php' => config_path('logreader.php') |
| 16 | + __DIR__.'/config.php' => config_path('logreader.php'), |
| 17 | 17 | ], 'config'); |
| 18 | 18 | } |
| 19 | 19 | |
src/config.phpmodified+1-1Changes to src/config.php | @@ -5,5 +5,5 @@ return [ |
| 5 | 5 | |
| 6 | 6 | 'path' => storage_path('logs'), |
| 7 | 7 | |
| 8 | | - 'env' => env('APP_ENV') |
| 8 | + 'env' => env('APP_ENV'), |
| 9 | 9 | ]; |
tests/LogReaderTest.phpmodifiedformatting only+3-3Changes to tests/LogReaderTest.php | @@ -2,8 +2,8 @@ |
| 2 | 2 | |
| 3 | 3 | namespace Mohamed\LaravelLogReader\Tests; |
| 4 | 4 | |
| 5 | | -use Illuminate\Filesystem\Filesystem; |
| 6 | 5 | use PHPUnit\Framework\TestCase; |
| 6 | +use Illuminate\Filesystem\Filesystem; |
| 7 | 7 | |
| 8 | 8 | class LogReaderTest extends TestCase |
| 9 | 9 | { |
| @@ -27,7 +27,7 @@ class LogReaderTest extends TestCase |
| 27 | 27 | $this->directory = 'logs_'.strtotime(now()); |
| 28 | 28 | |
| 29 | 29 | |
| 30 | | - $this->filesystem->makeDirectory(__DIR__ . '/'. $this->directory); |
| 30 | + $this->filesystem->makeDirectory(__DIR__.'/'.$this->directory); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | |
| @@ -35,6 +35,6 @@ class LogReaderTest extends TestCase |
| 35 | 35 | { |
| 36 | 36 | $this->assertTrue(true); |
| 37 | 37 | |
| 38 | | - $this->filesystem->deleteDirectory(__DIR__. '/'. $this->directory); |
| 38 | + $this->filesystem->deleteDirectory(__DIR__.'/'.$this->directory); |
| 39 | 39 | } |
| 40 | 40 | } |