OneOf implements Rule
Interfaces, Classes and Traits
Table of Contents
- $list : array<string|int, mixed>
- __construct() : mixed
- Initializing the rule
- check() : bool
- Checking the value with the given rule
- format() : string
- Get a string representation of the rule and parameters
Properties
$list
protected
array<string|int, mixed>
$list
Methods
__construct()
Initializing the rule
public
__construct(array<string|int, mixed> $list) : mixed
Parameters
- $list : array<string|int, mixed>
-
List of items
Return values
mixed —check()
Checking the value with the given rule
public
check(mixed $value) : bool
Parameters
- $value : mixed
-
The value to validate
Return values
bool —Validated or not
format()
Get a string representation of the rule and parameters
public
format() : string
Return values
string —Rule name and the parameter list shoud be spearated by a colon and parameter list should be separated by commas. Example:- in:outdoor,indoor