Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ValidValidator.php

function ValidValidator::validate

Overrides ConstraintValidatorInterface::validate

File

vendor/symfony/validator/Constraints/ValidValidator.php, line 23

Class

ValidValidator
@author Christian Flothmann <christian.flothmann@sensiolabs.de>

Namespace

Symfony\Component\Validator\Constraints

Code

public function validate(mixed $value, Constraint $constraint) : void {
    if (!$constraint instanceof Valid) {
        throw new UnexpectedTypeException($constraint, Valid::class);
    }
    if (null === $value) {
        return;
    }
    $this->context
        ->getValidator()
        ->inContext($this->context)
        ->validate($value, null, $this->context
        ->getGroup());
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal