You are here

public function ContextualValidatorInterface::validate in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/validator/Validator/ContextualValidatorInterface.php \Symfony\Component\Validator\Validator\ContextualValidatorInterface::validate()
  2. 8 core/lib/Drupal/Core/TypedData/Validation/ContextualValidatorInterface.php \Drupal\Core\TypedData\Validation\ContextualValidatorInterface::validate()
Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Validator/ContextualValidatorInterface.php \Symfony\Component\Validator\Validator\ContextualValidatorInterface::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

ContextualValidatorInterface This validator

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

File

vendor/symfony/validator/Validator/ContextualValidatorInterface.php, line 53

Class

ContextualValidatorInterface
A validator in a specific execution context.

Namespace

Symfony\Component\Validator\Validator

Code

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