You are here

public function ValidatorInterface::validate in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/validator/ValidatorInterface.php \Symfony\Component\Validator\ValidatorInterface::validate()
  2. 8 vendor/symfony/validator/Validator/ValidatorInterface.php \Symfony\Component\Validator\Validator\ValidatorInterface::validate()
Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Validator/ValidatorInterface.php \Symfony\Component\Validator\Validator\ValidatorInterface::validate()

Validates a value against a constraint or a list of constraints.

If no constraint is passed, the constraint {@link \Symfony\Component\Validator\Constraints\Valid} is assumed.

Parameters

mixed $value The value to validate:

Constraint|Constraint[] $constraints The constraint(s) to validate: against

array|null $groups The validation groups to: validate. If none is given, "Default" is assumed

Return value

ConstraintViolationListInterface A list of constraint violations. If the list is empty, validation succeeded

2 methods override ValidatorInterface::validate()
RecursiveValidator::validate in vendor/symfony/validator/Validator/RecursiveValidator.php
Validates a value against a constraint or a list of constraints.
RecursiveValidator::validate in core/lib/Drupal/Core/TypedData/Validation/RecursiveValidator.php
Validates a value against a constraint or a list of constraints.

File

vendor/symfony/validator/Validator/ValidatorInterface.php, line 45

Class

ValidatorInterface
Validates PHP values against constraints.

Namespace

Symfony\Component\Validator\Validator

Code

public function validate($value, $constraints = null, $groups = null);