mirror of
https://github.com/Respect/Validation.git
synced 2026-03-23 02:04:43 +01:00
Since the library doesn't need to give support to version 5.4 or less of PHP using variadics in the constructor of "AbstractFilterRule" seems better than doing the whole validation. This commit will also apply the contribution guidelines to "AbstractFilterRule" and use a better naming for it. Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
29 lines
612 B
Markdown
29 lines
612 B
Markdown
# Digit
|
|
|
|
- `Digit()`
|
|
- `Digit(string ...$additionalChars)`
|
|
|
|
Validates whether the input contains only digits.
|
|
|
|
```php
|
|
v::digit()->validate('020 612 1851'); // false
|
|
v::digit(' ')->validate('020 612 1851'); // true
|
|
v::digit()->validate('172.655.537-21'); // false
|
|
v::digit('.', '-')->validate('172.655.537-21'); // true
|
|
```
|
|
|
|
## Changelog
|
|
|
|
Version | Description
|
|
--------|-------------
|
|
2.0.0 | Removed support to whitespaces by default
|
|
0.5.0 | Renamed from `Digits` to `Digit`
|
|
0.3.9 | Created as `Digits`
|
|
|
|
***
|
|
See also:
|
|
|
|
- [Alnum](Alnum.md)
|
|
- [Alpha](Alpha.md)
|
|
- [Vowel](Vowel.md)
|
|
- [Consonant](Consonant.md)
|