respect-validation/docs/Not.md
Henrique Moody 66027b85a5 Documentation improvements
- Add a space after comments with `//`;
- Add missing "See also" sections in some files
2015-10-19 22:55:05 -02:00

24 lines
427 B
Markdown

# Not
- `v::not(v $negatedValidator)`
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.
***
See also:
* [NoneOf](NoneOf.md)