Final Class Yiisoft\Validator\Debug\ValidatorInterfaceProxy
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| validate() | Yiisoft\ |
Method Details
| public mixed __construct ( Yiisoft\ | ||
| $validator | Yiisoft\ |
|
| $collector | Yiisoft\ |
|
public function __construct(
private readonly ValidatorInterface $validator,
private readonly ValidatorCollector $collector,
) {}
| public Yiisoft\ | ||
| $data | mixed | |
| $rules | callable|iterable|object|string|null | |
| $context | ?\ |
|
public function validate(
mixed $data,
callable|iterable|object|string|null $rules = null,
?ValidationContext $context = null,
): Result {
$result = $this->validator->validate($data, $rules, $context);
if ($rules === null && $data instanceof RulesProviderInterface) {
$rules = (array) $data->getRules();
}
$this->collector->collect(
$data,
$result,
$rules,
);
return $result;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.