mirror of
https://github.com/Respect/Validation.git
synced 2026-03-18 08:09:51 +01:00
The method has been renamed some time ago, but I haven't updated the documentation to cause less confusion. Now that I want to start updating the documentation, I switched the default branch on GitHub to the latest stable version, so I assume there will be less confusion in the documentation, and I can start updating the docs for the next version.
1,019 B
1,019 B
Length
Length(Validatable $rule)
Validates the length of the given input against a given rule.
v::length(v::between(1, 5))->isValid('abc'); // true
v::length(v::greaterThan(5))->isValid('abcdef'); // true
v::length(v::lessThan(5))->isValid('abc'); // true
This rule can be used to validate the length of strings, arrays, and objects that implement the Countable interface.
v::length(v::greaterThanOrEqual(3))->isValid([1, 2, 3]); // true
v::length(v::equals(0))->isValid(new SplPriorityQueue()); // true
Categorization
- Comparisons
- Transformations
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Became a transformation |
| 0.3.9 | Created |
See also: