respect-validation/docs/AllOf.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

550 B

AllOf

  • v::allOf(v $v1, v $v2, v $v3...)

Will validate if all inner validators validates.

v::allOf(
    v::intVal(),
    v::positive()
)->validate(15); // true

This is similar to the chain (which is an allOf already), but its syntax allows you to set custom names for every node:

v::allOf(
    v::intVal()->setName('Account Number'),
    v::positive()->setName('Higher Than Zero')
)->setName('Positive integer')
 ->validate(15); // true

See also: