From 73c52e16e9e12857dbf98d9e1f53f2e9dc92ef64 Mon Sep 17 00:00:00 2001 From: Bastien Philippe Date: Wed, 4 Sep 2024 15:24:37 +0200 Subject: [PATCH] Fix $fail closure type in docblocks for validation rules --- src/Illuminate/Contracts/Validation/InvokableRule.php | 2 +- src/Illuminate/Contracts/Validation/ValidationRule.php | 2 +- src/Illuminate/Foundation/Console/stubs/rule.implicit.stub | 2 +- src/Illuminate/Foundation/Console/stubs/rule.stub | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Illuminate/Contracts/Validation/InvokableRule.php b/src/Illuminate/Contracts/Validation/InvokableRule.php index c7ac9c248def..bed9ed567fb4 100644 --- a/src/Illuminate/Contracts/Validation/InvokableRule.php +++ b/src/Illuminate/Contracts/Validation/InvokableRule.php @@ -14,7 +14,7 @@ interface InvokableRule * * @param string $attribute * @param mixed $value - * @param \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail + * @param \Closure(string, ?string = null): \Illuminate\Translation\PotentiallyTranslatedString $fail * @return void */ public function __invoke(string $attribute, mixed $value, Closure $fail); diff --git a/src/Illuminate/Contracts/Validation/ValidationRule.php b/src/Illuminate/Contracts/Validation/ValidationRule.php index 1c95b975c4bc..c687b26a2d98 100644 --- a/src/Illuminate/Contracts/Validation/ValidationRule.php +++ b/src/Illuminate/Contracts/Validation/ValidationRule.php @@ -11,7 +11,7 @@ interface ValidationRule * * @param string $attribute * @param mixed $value - * @param \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail + * @param \Closure(string, ?string = null): \Illuminate\Translation\PotentiallyTranslatedString $fail * @return void */ public function validate(string $attribute, mixed $value, Closure $fail): void; diff --git a/src/Illuminate/Foundation/Console/stubs/rule.implicit.stub b/src/Illuminate/Foundation/Console/stubs/rule.implicit.stub index 341f842a6271..e04915bf5852 100644 --- a/src/Illuminate/Foundation/Console/stubs/rule.implicit.stub +++ b/src/Illuminate/Foundation/Console/stubs/rule.implicit.stub @@ -17,7 +17,7 @@ class {{ class }} implements ValidationRule /** * Run the validation rule. * - * @param \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail + * @param \Closure(string, ?string = null): \Illuminate\Translation\PotentiallyTranslatedString $fail */ public function validate(string $attribute, mixed $value, Closure $fail): void { diff --git a/src/Illuminate/Foundation/Console/stubs/rule.stub b/src/Illuminate/Foundation/Console/stubs/rule.stub index e54d7efaedab..7b54420895b4 100644 --- a/src/Illuminate/Foundation/Console/stubs/rule.stub +++ b/src/Illuminate/Foundation/Console/stubs/rule.stub @@ -10,7 +10,7 @@ class {{ class }} implements ValidationRule /** * Run the validation rule. * - * @param \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail + * @param \Closure(string, ?string = null): \Illuminate\Translation\PotentiallyTranslatedString $fail */ public function validate(string $attribute, mixed $value, Closure $fail): void {