mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
chore: fix code style
This commit is contained in:
committed by
github-actions[bot]
parent
bb26af930a
commit
a99512aae4
@@ -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;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -125,7 +125,7 @@ class ToggleColumn extends Column implements Editable, HasEmbeddedView
|
||||
<div aria-hidden="true">
|
||||
<?= generate_icon_html(
|
||||
$onIcon,
|
||||
attributes: (new ComponentattributeBag)->merge(['x-cloak' => true], escape: false),
|
||||
attributes: (new ComponentAttributeBag)->merge(['x-cloak' => true], escape: false),
|
||||
)?->toHtml() ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+7
-7
@@ -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()
|
||||
|
||||
+3
-3
@@ -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();
|
||||
|
||||
|
||||
+4
-4
@@ -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();
|
||||
|
||||
|
||||
+3
-3
@@ -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();
|
||||
|
||||
|
||||
+4
-4
@@ -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();
|
||||
|
||||
|
||||
+3
-3
@@ -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();
|
||||
|
||||
|
||||
+8
-8
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user