From a99512aae4b223eedd03e7e471b74395c9a67d73 Mon Sep 17 00:00:00 2001 From: thethunderturner Date: Mon, 2 Dec 2024 15:12:20 +0000 Subject: [PATCH] chore: fix code style --- packages/infolists/src/Components/Entry.php | 3 ++- .../Providers/DefaultGlobalSearchProvider.php | 3 +-- packages/tables/src/Columns/ToggleColumn.php | 2 +- .../EmailCodeAuthenticationChallengeTest.php | 14 +++++++------- .../RemoveEmailCodeAuthenticationActionTest.php | 6 +++--- .../SetUpEmailCodeAuthenticationActionTest.php | 8 ++++---- ...ctorAuthenticationRecoveryCodesActionTest.php | 6 +++--- ...veGoogleTwoFactorAuthenticationActionTest.php | 8 ++++---- ...UpGoogleTwoFactorAuthenticationActionTest.php | 6 +++--- ...oogleTwoFactorAuthenticationChallengeTest.php | 16 ++++++++-------- 10 files changed, 36 insertions(+), 36 deletions(-) diff --git a/packages/infolists/src/Components/Entry.php b/packages/infolists/src/Components/Entry.php index 1b9c2b42a8..0fc1281ee3 100644 --- a/packages/infolists/src/Components/Entry.php +++ b/packages/infolists/src/Components/Entry.php @@ -6,6 +6,7 @@ use Closure; use Exception; use Filament\Actions\Action; use Filament\Schemas\Components\Component; +use Filament\Schemas\Components\Concerns\CanOpenUrl; use Filament\Schemas\Components\Decorations\Layouts\DecorationsLayout; use Filament\Support\Concerns\HasAlignment; use Filament\Support\Concerns\HasPlaceholder; @@ -14,11 +15,11 @@ use Illuminate\Contracts\Support\Htmlable; class Entry extends Component { + use CanOpenUrl; use Concerns\HasExtraEntryWrapperAttributes; use Concerns\HasHelperText; use Concerns\HasHint; use Concerns\HasName; - use \Filament\Schemas\Components\Concerns\CanOpenUrl; use HasAlignment; use HasPlaceholder; use HasTooltip; diff --git a/packages/panels/src/GlobalSearch/Providers/DefaultGlobalSearchProvider.php b/packages/panels/src/GlobalSearch/Providers/DefaultGlobalSearchProvider.php index 9b1b59ac71..5aa08db16e 100644 --- a/packages/panels/src/GlobalSearch/Providers/DefaultGlobalSearchProvider.php +++ b/packages/panels/src/GlobalSearch/Providers/DefaultGlobalSearchProvider.php @@ -4,9 +4,8 @@ namespace Filament\GlobalSearch\Providers; use Filament\Facades\Filament; use Filament\GlobalSearch\GlobalSearchResults; -use Filament\GlobalSearch\Providers; -class DefaultGlobalSearchProvider implements Providers\Contracts\GlobalSearchProvider +class DefaultGlobalSearchProvider implements Contracts\GlobalSearchProvider { public function getResults(string $query): ?GlobalSearchResults { diff --git a/packages/tables/src/Columns/ToggleColumn.php b/packages/tables/src/Columns/ToggleColumn.php index ecc24313b8..ec832f4397 100644 --- a/packages/tables/src/Columns/ToggleColumn.php +++ b/packages/tables/src/Columns/ToggleColumn.php @@ -125,7 +125,7 @@ class ToggleColumn extends Column implements Editable, HasEmbeddedView diff --git a/tests/src/Panels/Auth/MultiFactorAuthentication/EmailCode/EmailCodeAuthenticationChallengeTest.php b/tests/src/Panels/Auth/MultiFactorAuthentication/EmailCode/EmailCodeAuthenticationChallengeTest.php index 853e9d7e44..b664650a05 100644 --- a/tests/src/Panels/Auth/MultiFactorAuthentication/EmailCode/EmailCodeAuthenticationChallengeTest.php +++ b/tests/src/Panels/Auth/MultiFactorAuthentication/EmailCode/EmailCodeAuthenticationChallengeTest.php @@ -21,7 +21,7 @@ beforeEach(function () { }); it('can render the challenge form after valid login credentials are successfully used', function () { - $emailCodeAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $emailCodeAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $userToAuthenticate = User::factory() ->hasEmailCodeAuthentication() @@ -52,7 +52,7 @@ it('can render the challenge form after valid login credentials are successfully }); it('will authenticate the user after a valid challenge code is used', function () { - $emailCodeAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $emailCodeAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $userToAuthenticate = User::factory() ->hasEmailCodeAuthentication() @@ -79,7 +79,7 @@ it('will authenticate the user after a valid challenge code is used', function ( }); it('can resend the code to the user', function () { - $emailCodeAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $emailCodeAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $userToAuthenticate = User::factory() ->hasEmailCodeAuthentication() @@ -140,7 +140,7 @@ it('will not render the challenge form if a user does not have multi-factor auth }); it('will not authenticate the user when an invalid challenge code is used', function () { - $emailCodeAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $emailCodeAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $userToAuthenticate = User::factory() ->hasEmailCodeAuthentication() @@ -171,7 +171,7 @@ it('will not authenticate the user when an invalid challenge code is used', func }); test('challenge codes are required', function () { - $emailCodeAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $emailCodeAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $userToAuthenticate = User::factory() ->hasEmailCodeAuthentication() @@ -200,7 +200,7 @@ test('challenge codes are required', function () { }); test('challenge codes must be numeric', function () { - $emailCodeAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $emailCodeAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $userToAuthenticate = User::factory() ->hasEmailCodeAuthentication() @@ -229,7 +229,7 @@ test('challenge codes must be numeric', function () { }); test('challenge codes must be 6 digits', function () { - $emailCodeAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $emailCodeAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $userToAuthenticate = User::factory() ->hasEmailCodeAuthentication() diff --git a/tests/src/Panels/Auth/MultiFactorAuthentication/EmailCode/RemoveEmailCodeAuthenticationActionTest.php b/tests/src/Panels/Auth/MultiFactorAuthentication/EmailCode/RemoveEmailCodeAuthenticationActionTest.php index 6e58b22609..0d7ee9c858 100644 --- a/tests/src/Panels/Auth/MultiFactorAuthentication/EmailCode/RemoveEmailCodeAuthenticationActionTest.php +++ b/tests/src/Panels/Auth/MultiFactorAuthentication/EmailCode/RemoveEmailCodeAuthenticationActionTest.php @@ -26,7 +26,7 @@ beforeEach(function () { }); it('can remove authentication when valid challenge code is used', function () { - $emailCodeAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $emailCodeAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $user = auth()->user(); @@ -76,7 +76,7 @@ it('can resend the code to the user', function () { }); it('will not remove authentication when an invalid code is used', function () { - $emailCodeAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $emailCodeAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $user = auth()->user(); @@ -128,7 +128,7 @@ test('codes are required', function () { }); test('codes must be 6 digits', function () { - $emailCodeAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $emailCodeAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $user = auth()->user(); diff --git a/tests/src/Panels/Auth/MultiFactorAuthentication/EmailCode/SetUpEmailCodeAuthenticationActionTest.php b/tests/src/Panels/Auth/MultiFactorAuthentication/EmailCode/SetUpEmailCodeAuthenticationActionTest.php index dc1442caa6..cd62826e04 100644 --- a/tests/src/Panels/Auth/MultiFactorAuthentication/EmailCode/SetUpEmailCodeAuthenticationActionTest.php +++ b/tests/src/Panels/Auth/MultiFactorAuthentication/EmailCode/SetUpEmailCodeAuthenticationActionTest.php @@ -24,7 +24,7 @@ beforeEach(function () { }); it('can generate a secret when the action is mounted', function () { - $emailCodeAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $emailCodeAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $livewire = livewire(EditProfile::class) ->mountAction(TestAction::make('setUpEmailCodeAuthentication') @@ -58,7 +58,7 @@ it('can generate a secret when the action is mounted', function () { }); it('can save the secret to the user when the action is submitted', function () { - $emailCodeAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $emailCodeAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $user = auth()->user(); @@ -102,7 +102,7 @@ it('can resend the code to the user', function () { }); it('will not set up authentication when an invalid code is used', function () { - $emailCodeAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $emailCodeAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $user = auth()->user(); @@ -159,7 +159,7 @@ test('codes are required', function () { }); test('codes must be 6 digits', function () { - $emailCodeAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $emailCodeAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $user = auth()->user(); diff --git a/tests/src/Panels/Auth/MultiFactorAuthentication/GoogleTwoFactor/Actions/RegenerateGoogleTwoFactorAuthenticationRecoveryCodesActionTest.php b/tests/src/Panels/Auth/MultiFactorAuthentication/GoogleTwoFactor/Actions/RegenerateGoogleTwoFactorAuthenticationRecoveryCodesActionTest.php index 00d0b9f0d8..6e1bc32158 100644 --- a/tests/src/Panels/Auth/MultiFactorAuthentication/GoogleTwoFactor/Actions/RegenerateGoogleTwoFactorAuthenticationRecoveryCodesActionTest.php +++ b/tests/src/Panels/Auth/MultiFactorAuthentication/GoogleTwoFactor/Actions/RegenerateGoogleTwoFactorAuthenticationRecoveryCodesActionTest.php @@ -22,7 +22,7 @@ beforeEach(function () { }); it('can generate new recovery codes when valid challenge code is used', function () { - $googleTwoFactorAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $googleTwoFactorAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $user = auth()->user(); @@ -114,7 +114,7 @@ it('can generate new recovery codes when the current user\'s password is used', }); it('will not generate new recovery codes when an invalid code is used', function () { - $googleTwoFactorAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $googleTwoFactorAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $user = auth()->user(); @@ -162,7 +162,7 @@ test('codes are required without the user\'s current password', function () { }); test('codes must be 6 digits', function () { - $googleTwoFactorAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $googleTwoFactorAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $user = auth()->user(); diff --git a/tests/src/Panels/Auth/MultiFactorAuthentication/GoogleTwoFactor/Actions/RemoveGoogleTwoFactorAuthenticationActionTest.php b/tests/src/Panels/Auth/MultiFactorAuthentication/GoogleTwoFactor/Actions/RemoveGoogleTwoFactorAuthenticationActionTest.php index 5d2a075f37..96f14d1bec 100644 --- a/tests/src/Panels/Auth/MultiFactorAuthentication/GoogleTwoFactor/Actions/RemoveGoogleTwoFactorAuthenticationActionTest.php +++ b/tests/src/Panels/Auth/MultiFactorAuthentication/GoogleTwoFactor/Actions/RemoveGoogleTwoFactorAuthenticationActionTest.php @@ -16,7 +16,7 @@ uses(TestCase::class); beforeEach(function () { Filament::setCurrentPanel('google-two-factor-authentication'); - $googleTwoFactorAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $googleTwoFactorAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $this->recoveryCodes = $googleTwoFactorAuthentication->generateRecoveryCodes(); @@ -26,7 +26,7 @@ beforeEach(function () { }); it('can remove authentication when valid challenge code is used', function () { - $googleTwoFactorAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $googleTwoFactorAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $user = auth()->user(); @@ -95,7 +95,7 @@ it('can remove authentication when a valid recovery code is used', function () { }); it('will not remove authentication when an invalid code is used', function () { - $googleTwoFactorAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $googleTwoFactorAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $user = auth()->user(); @@ -163,7 +163,7 @@ test('codes are required without a recovery code', function () { }); test('codes must be 6 digits', function () { - $googleTwoFactorAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $googleTwoFactorAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $user = auth()->user(); diff --git a/tests/src/Panels/Auth/MultiFactorAuthentication/GoogleTwoFactor/Actions/SetUpGoogleTwoFactorAuthenticationActionTest.php b/tests/src/Panels/Auth/MultiFactorAuthentication/GoogleTwoFactor/Actions/SetUpGoogleTwoFactorAuthenticationActionTest.php index 18114a9a89..a952a62d23 100644 --- a/tests/src/Panels/Auth/MultiFactorAuthentication/GoogleTwoFactor/Actions/SetUpGoogleTwoFactorAuthenticationActionTest.php +++ b/tests/src/Panels/Auth/MultiFactorAuthentication/GoogleTwoFactor/Actions/SetUpGoogleTwoFactorAuthenticationActionTest.php @@ -60,7 +60,7 @@ it('can generate a secret and recovery codes when the action is mounted', functi }); it('can save the secret and recovery codes to the user when the action is submitted', function () { - $googleTwoFactorAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $googleTwoFactorAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $user = auth()->user(); @@ -104,7 +104,7 @@ it('can save the secret and recovery codes to the user when the action is submit }); it('will not set up authentication when an invalid code is used', function () { - $googleTwoFactorAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $googleTwoFactorAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $user = auth()->user(); @@ -177,7 +177,7 @@ test('codes are required', function () { }); test('codes must be 6 digits', function () { - $googleTwoFactorAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $googleTwoFactorAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $user = auth()->user(); diff --git a/tests/src/Panels/Auth/MultiFactorAuthentication/GoogleTwoFactor/GoogleTwoFactorAuthenticationChallengeTest.php b/tests/src/Panels/Auth/MultiFactorAuthentication/GoogleTwoFactor/GoogleTwoFactorAuthenticationChallengeTest.php index 7ca2d49924..ecc3e7c583 100644 --- a/tests/src/Panels/Auth/MultiFactorAuthentication/GoogleTwoFactor/GoogleTwoFactorAuthenticationChallengeTest.php +++ b/tests/src/Panels/Auth/MultiFactorAuthentication/GoogleTwoFactor/GoogleTwoFactorAuthenticationChallengeTest.php @@ -39,7 +39,7 @@ it('can render the challenge form after valid login credentials are successfully }); it('will authenticate the user after a valid challenge code is used', function () { - $googleTwoFactorAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $googleTwoFactorAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $userToAuthenticate = User::factory() ->hasGoogleTwoFactorAuthentication() @@ -66,7 +66,7 @@ it('will authenticate the user after a valid challenge code is used', function ( }); it('will make the recovery code field visible when the user requests it', function () { - $googleTwoFactorAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $googleTwoFactorAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $userToAuthenticate = User::factory() ->hasGoogleTwoFactorAuthentication() @@ -95,7 +95,7 @@ it('will make the recovery code field visible when the user requests it', functi }); it('will authenticate the user after a valid recovery code is used', function () { - $googleTwoFactorAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $googleTwoFactorAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $userToAuthenticate = User::factory() ->hasGoogleTwoFactorAuthentication($recoveryCodes = $googleTwoFactorAuthentication->generateRecoveryCodes()) @@ -158,7 +158,7 @@ it('will not render the challenge form if a user does not have multi-factor auth }); it('will not authenticate the user when an invalid challenge code is used', function () { - $googleTwoFactorAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $googleTwoFactorAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $userToAuthenticate = User::factory() ->hasGoogleTwoFactorAuthentication() @@ -189,7 +189,7 @@ it('will not authenticate the user when an invalid challenge code is used', func }); test('challenge codes are required', function () { - $googleTwoFactorAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $googleTwoFactorAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $userToAuthenticate = User::factory() ->hasGoogleTwoFactorAuthentication() @@ -218,7 +218,7 @@ test('challenge codes are required', function () { }); test('challenge codes must be numeric', function () { - $googleTwoFactorAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $googleTwoFactorAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $userToAuthenticate = User::factory() ->hasGoogleTwoFactorAuthentication() @@ -247,7 +247,7 @@ test('challenge codes must be numeric', function () { }); test('challenge codes must be 6 digits', function () { - $googleTwoFactorAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $googleTwoFactorAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $userToAuthenticate = User::factory() ->hasGoogleTwoFactorAuthentication() @@ -276,7 +276,7 @@ test('challenge codes must be 6 digits', function () { }); it('will not authenticate the user when an invalid recovery code is used', function () { - $googleTwoFactorAuthentication = Arr::first(filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); + $googleTwoFactorAuthentication = Arr::first(Filament::getCurrentPanel()->getMultiFactorAuthenticationProviders()); $userToAuthenticate = User::factory() ->hasGoogleTwoFactorAuthentication()