From ea7c7dafed3c7987b424721999f0bf1b16dada9d Mon Sep 17 00:00:00 2001 From: Chrysanthos <48060191+chrysanthos@users.noreply.github.com> Date: Sat, 11 Jan 2020 18:26:53 +0200 Subject: [PATCH] Apply fixes from StyleCI (#2) --- src/AuthLoggingServiceProvider.php | 1 - src/Jobs/LogAuthAction.php | 2 +- tests/TestLogAuthActionJob.php | 15 +++++++-------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/AuthLoggingServiceProvider.php b/src/AuthLoggingServiceProvider.php index 38972b5..40b5050 100644 --- a/src/AuthLoggingServiceProvider.php +++ b/src/AuthLoggingServiceProvider.php @@ -26,7 +26,6 @@ public function boot() $this->publishes([ __DIR__.'/../config/auth-logging.php' => config_path('auth-logging.php'), ], 'config'); - } /** diff --git a/src/Jobs/LogAuthAction.php b/src/Jobs/LogAuthAction.php index 7c5c5ab..41feaf2 100644 --- a/src/Jobs/LogAuthAction.php +++ b/src/Jobs/LogAuthAction.php @@ -70,7 +70,7 @@ protected function getEmail() */ protected function getPassword() { - $value = $this->payload['password']; + $value = $this->payload['password']; $maskedFields = config('auth-logging.mask', []); return in_array('password', $maskedFields, true) diff --git a/tests/TestLogAuthActionJob.php b/tests/TestLogAuthActionJob.php index ebd57ff..a54506d 100644 --- a/tests/TestLogAuthActionJob.php +++ b/tests/TestLogAuthActionJob.php @@ -9,7 +9,6 @@ class TestLogAuthActionJob extends TestCase { - protected $credentials = ['email' => 'first@chrysanthos.dev', 'password' => 'password']; public function test_that_it_stores_the_credentials_when_enabled() @@ -32,7 +31,7 @@ public function test_that_it_does_not_store_the_credentials_when_disabled() $this->credentials = [ 'email' => 'second@chrysanthos.dev', - 'password' => 'password' + 'password' => 'password', ]; event(new Failed('web', $this->getUser(), $this->credentials)); @@ -48,14 +47,14 @@ public function test_that_it_masks_fields_successfully() $this->credentials = [ 'email' => 'second@chrysanthos.dev', - 'password' => 'password' + 'password' => 'password', ]; event(new Failed('web', $this->getUser(), $this->credentials)); $this->assertDatabaseHas('auth_logs', [ 'email' => '***ond@chrysanthos.dev', - 'password' => '****word' + 'password' => '****word', ]); } @@ -67,28 +66,28 @@ public function test_that_it_masks_selected_field_successfully() $this->credentials = [ 'email' => 'second@chrysanthos.dev', - 'password' => 'password' + 'password' => 'password', ]; event(new Failed('web', $this->getUser(), $this->credentials)); $this->assertDatabaseHas('auth_logs', [ 'email' => 'second@chrysanthos.dev', - 'password' => '****word' + 'password' => '****word', ]); } protected function getUser() { return tap(new User, function ($user) { - $user->email = $this->credentials['email']; + $user->email = $this->credentials['email']; $user->password = $this->credentials['password']; return $user; }); } - protected function migrate() : void + protected function migrate(): void { $this->loadLaravelMigrations(); $this->artisan('migrate')->run();