Skip to content

Commit 368a006

Browse files
committed
add to string method
1 parent c0809b1 commit 368a006

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/Fixtures/UppercaseRule.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@ class UppercaseRule implements ValidationRule
1515
* @param \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail
1616
* @return void
1717
*/
18-
public function validate(string $attribute, mixed $value, Closure $fail): void
18+
public function validate(string $attribute, mixed $value, Closure $fail): void
1919
{
2020
if (strtoupper($value) !== $value) {
2121
$fail("The {$attribute} must be uppercase.");
2222
}
2323
}
24+
25+
public function __toString(): string
26+
{
27+
return 'uppercase';
28+
}
2429
}

0 commit comments

Comments
 (0)