Final Class Yiisoft\Validator\Rule\CompositeHandler
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
A handler for {@see Composite} handler. Validates group of rules.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| validate() | Yiisoft\ |
Method Details
| public Yiisoft\ | ||
| $value | mixed | |
| $rule | Yiisoft\ |
|
| $context | Yiisoft\ |
|
public function validate(mixed $value, RuleInterface $rule, ValidationContext $context): Result
{
if (!$rule instanceof Composite) {
throw new UnexpectedRuleException(Composite::class, $rule);
}
return $context->validate($value, $rule->getRules());
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.