Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 16eeb75

Browse files
committed
docs: fixed normalizer example from length rule
1 parent 0498dc3 commit 16eeb75

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/03-rules_length.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ Allows to define a `callable` that will be applied to the value before checking
9999
For example, use `trim`, or pass your own function, to not measure whitespaces at the end of a string:
100100

101101
```php
102-
// existing php callables
102+
Validator::length(max: 3)->validate('abc '); // false
103+
103104
Validator::length(max: 3, normalizer: 'trim')->validate('abc '); // true
104-
// function
105-
Validator::length(max: 3, normalizer: fn($value) => trim($value))->validate('abc '); // false
105+
Validator::length(max: 3, normalizer: fn($value) => trim($value))->validate('abc '); // true
106106
```
107107

108108
### `minMessage`

0 commit comments

Comments
 (0)