ReviewOS

also looking at this

ci-on/laravel-log-reader

Apply fixes from StyleCI

#1
Merged chris wants to merge analysis-qvaDZr into master
5 files +11 -12
src/Reader/LineReader.phpmodified+6-6
Changes to src/Reader/LineReader.php
@@ -17,7 +17,7 @@ class LineReader
1717 'ERROR',
1818 'WARNING',
1919 'NOTICE',
20 'INFO'
20 'INFO',
2121 ];
2222
2323 public $type;
formatting only · 8 hidden lines
Changes to src/Reader/LineReader.php
@@ -32,7 +32,7 @@ class LineReader formatting only
3232 {
3333 $this->line = $line;
3434
35 if(request()->filled('logreader_type') && request('logreader_type') !== 'all') {
35 if (request()->filled('logreader_type') && request('logreader_type') !== 'all') {
3636 $this->types = [strtoupper(request()->logreader_type)];
3737 }
3838 }
Changes to src/Reader/LineReader.php
@@ -51,9 +51,9 @@ class LineReader
5151 public function getArray()
5252 {
5353 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,
5757 ];
5858 }
5959
@@ -88,7 +88,7 @@ class LineReader
8888
8989 public function retrieveMessage()
9090 {
91 $this->message = Str::replaceFirst(config('logreader.env').'.'.$this->type.": ", '', $this->LineWithoutDate());
91 $this->message = Str::replaceFirst(config('logreader.env').'.'.$this->type.': ', '', $this->LineWithoutDate());
9292 }
9393
9494 public function hasLoggerType($type)
src/Reader/LogReader.phpmodifiedformatting only+0-1
Changes to src/Reader/LogReader.php
@@ -69,7 +69,6 @@ class LogReader
6969 return $this;
7070 }
7171
72
7372 public function yesterday()
7473 {
7574 $this->time = now()->subDay()->format('Y-m-d');
src/ServiceProvider.phpmodified+1-1
Changes to src/ServiceProvider.php
@@ -13,7 +13,7 @@ class ServiceProvider extends BaseServiceProvider
1313 $this->loadRoutesFrom(__DIR__.'/routes.php');
1414
1515 $this->publishes([
16 __DIR__.'/config.php' => config_path('logreader.php')
16 __DIR__.'/config.php' => config_path('logreader.php'),
1717 ], 'config');
1818 }
1919
src/config.phpmodified+1-1
Changes to src/config.php
@@ -5,5 +5,5 @@ return [
55
66 'path' => storage_path('logs'),
77
8 'env' => env('APP_ENV')
8 'env' => env('APP_ENV'),
99];
tests/LogReaderTest.phpmodifiedformatting only+3-3
Changes to tests/LogReaderTest.php
@@ -2,8 +2,8 @@
22
33namespace Mohamed\LaravelLogReader\Tests;
44
5use Illuminate\Filesystem\Filesystem;
65use PHPUnit\Framework\TestCase;
6use Illuminate\Filesystem\Filesystem;
77
88class LogReaderTest extends TestCase
99{
@@ -27,7 +27,7 @@ class LogReaderTest extends TestCase
2727 $this->directory = 'logs_'.strtotime(now());
2828
2929 // Create Test Folder
30 $this->filesystem->makeDirectory(__DIR__ . '/'. $this->directory);
30 $this->filesystem->makeDirectory(__DIR__.'/'.$this->directory);
3131 }
3232
3333 /** @test */
@@ -35,6 +35,6 @@ class LogReaderTest extends TestCase
3535 {
3636 $this->assertTrue(true);
3737
38 $this->filesystem->deleteDirectory(__DIR__. '/'. $this->directory);
38 $this->filesystem->deleteDirectory(__DIR__.'/'.$this->directory);
3939 }
4040}