From 4ed26a57e1ac016c0a40a298532177cc3521cf9b Mon Sep 17 00:00:00 2001 From: Owen Voke Date: Mon, 7 Sep 2026 17:29:37 +0100 Subject: [PATCH] style: update Pint config --- app/Concerns/ProfileValidationRules.php | 4 ++-- app/Providers/AppServiceProvider.php | 2 +- database/factories/UserFactory.php | 2 +- pint.json | 11 ++++++++++- tests/TestCase.php | 2 +- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/app/Concerns/ProfileValidationRules.php b/app/Concerns/ProfileValidationRules.php index fc56187..cb47a8f 100644 --- a/app/Concerns/ProfileValidationRules.php +++ b/app/Concerns/ProfileValidationRules.php @@ -16,7 +16,7 @@ trait ProfileValidationRules * * @return array|string>> */ - protected function profileRules(?int $userId = null): array + protected function profileRules(int|null $userId = null): array { return [ 'name' => $this->nameRules(), @@ -39,7 +39,7 @@ protected function nameRules(): array * * @return array|string> */ - protected function emailRules(?int $userId = null): array + protected function emailRules(int|null $userId = null): array { return [ 'required', diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index f16d1b5..7961239 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -39,7 +39,7 @@ protected function configureDefaults(): void app()->isProduction(), ); - Password::defaults(fn (): ?Password => app()->isProduction() + Password::defaults(fn (): Password|null => app()->isProduction() ? Password::min(12) ->mixedCase() ->letters() diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index e0243c0..c278774 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -17,7 +17,7 @@ class UserFactory extends Factory /** * The current password being used by the factory. */ - protected static ?string $password; + protected static string|null $password; /** * Define the model's default state. diff --git a/pint.json b/pint.json index 93061b6..fc05d62 100644 --- a/pint.json +++ b/pint.json @@ -1,3 +1,12 @@ { - "preset": "laravel" + "preset": "laravel", + "rules": { + "declare_strict_types": true, + "nullable_type_declaration": { + "syntax": "union" + }, + "ordered_types": { + "null_adjustment": "always_last" + } + } } diff --git a/tests/TestCase.php b/tests/TestCase.php index f6eedbc..d977f52 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -16,7 +16,7 @@ protected function setUp(): void $this->withoutVite(); } - protected function skipUnlessFortifyHas(string $feature, ?string $message = null): void + protected function skipUnlessFortifyHas(string $feature, string|null $message = null): void { if (! Features::enabled($feature)) { $this->markTestSkipped($message ?? "Fortify feature [{$feature}] is not enabled.");