respect-validation/docs/rules/Callback.md

32 lines
470 B
Markdown
Raw Normal View History

2015-01-30 09:40:06 +01:00
# Callback
- `Callback(callable $callback)`
2015-01-30 09:40:06 +01:00
Validates the input using the return of a given callable.
2015-01-30 09:40:06 +01:00
```php
v::callback(
function (int $input): bool {
return $input + ($input / 2) == 15;
}
)->validate(10); // true
2015-01-30 09:40:06 +01:00
```
## Categorization
- Callables
## Changelog
Version | Description
--------|-------------
0.3.9 | Created
***
2015-01-30 09:40:06 +01:00
See also:
- [Call](Call.md)
- [CallableType](CallableType.md)
- [DateTime](DateTime.md)
- [FilterVar](FilterVar.md)