AnyOfRule
extends AbstractRule
in package
いずれか1つ以上のルールが成功することを要求します(論理OR)
複数のルールのうち、少なくとも1つが成功すればバリデーション成功となります。
OpenAPI 3.0の anyOf に対応します。
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- assert() : void
- validate() : bool
- raiseError() : RuleExceptionInterface
Properties
$message
protected
string
$message
= 'いずれかのルールを満たす必要があります。'
$rules
private
array<string|int, mixed>
$rules
Methods
__construct()
public
__construct(array<string|int, ValidatorInterface> $rules[, string $message = 'いずれかのルールを満たす必要があります。' ]) : mixed
Parameters
- $rules : array<string|int, ValidatorInterface>
- $message : string = 'いずれかのルールを満たす必要があります。'
assert()
public
assert(mixed $value) : void
Parameters
- $value : mixed
validate()
public
validate(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolraiseError()
protected
raiseError() : RuleExceptionInterface