1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00
movim_ynh/sources/vendor/respect/validation/docs/OneOf.md
2016-03-14 23:16:11 +01:00

442 B

OneOf

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

This is a group validator that acts as an OR operator.

v::oneOf(
    v::intVal(),
    v::floatVal()
)->validate(15.5); // true

In the sample above, v::intVal() doesn't validates, but v::floatVal() validates, so oneOf returns true.

v::oneOf returns true if at least one inner validator passes.


See also: