respect-validation/docs/rules/Not.md
Henrique Moody 10df3211f5
Add "Categorization" section to rule documentations
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-05-11 19:16:21 +02:00

36 lines
541 B
Markdown

# Not
- `Not(Validatable $rule)`
Negates any rule.
```php
v::not(v::ip())->validate('foo'); // true
```
In the sample above, validator returns true because 'foo' isn't an IP Address.
You can negate complex, grouped or chained validators as well:
```php
v::not(v::intVal()->positive())->validate(-1.5); // true
```
Each other validation has custom messages for negated rules.
## Categorization
- Conditions
- Nesting
## Changelog
Version | Description
--------|-------------
0.3.9 | Created
***
See also:
- [NoneOf](NoneOf.md)