Final Class Yiisoft\Validator\Rule\CompositeHandler
| Inheritance | Yiisoft\Validator\Rule\CompositeHandler |
|---|---|
| Implements | Yiisoft\Validator\RuleHandlerInterface |
A handler for {@see Composite} handler. Validates group of rules.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| validate() | Yiisoft\Validator\Rule\CompositeHandler |
Method Details
| public Yiisoft\Validator\Result validate ( mixed $value, Yiisoft\Validator\RuleInterface $rule, Yiisoft\Validator\ValidationContext $context ) | ||
| $value | mixed | |
| $rule | Yiisoft\Validator\RuleInterface | |
| $context | Yiisoft\Validator\ValidationContext | |
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());
}
Signup or Login in order to comment.