Skip to content

Commit

Permalink
[Fix] PHPStan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Baspa committed Aug 23, 2024
1 parent ae786da commit fc4c936
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"require": {
"php": "^8.1",
"filament/filament": "^3.0",
"filament/support": "^3.2",
"laravel/fortify": "^1.23",
"spatie/laravel-package-tools": "^1.15.0"
},
Expand Down
4 changes: 2 additions & 2 deletions src/Enums/TwoFactorType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ enum TwoFactorType: string implements HasLabel

public static function values(): array
{
return array_map(fn ($type) => $type->label(), self::cases());
return array_map(fn($type) => $type->getLabel(), self::cases());
}

public function getLabel(): ?string
Expand All @@ -26,4 +26,4 @@ public function getLabel(): ?string
self::phone => __('SMS'),
};
}
}
}
8 changes: 3 additions & 5 deletions src/Pages/TwoFactor.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function getConfirmationForm(): array
return [
TextInput::make('current_password')
->label(__('Password'))
->dehydrateStateUsing(fn ($state) => filled($state))
->dehydrateStateUsing(fn($state) => filled($state))
->required()
->password()
->inlineLabel()
Expand Down Expand Up @@ -141,9 +141,7 @@ public function enableAction(): Action
$this->showQrCode = true;
}

if (count($formData) > 0) {
auth()->user()->update($formData);
}
auth()->user()->update($formData);

$this->enableTwoFactorAuthentication(app(EnableTwoFactorAuthentication::class));
});
Expand Down Expand Up @@ -231,4 +229,4 @@ public function regenerateRecoveryCodes(GenerateNewRecoveryCodes $generate): voi

$this->showingRecoveryCodes = true;
}
}
}

0 comments on commit fc4c936

Please sign in to comment.