function UploadedFileValidator::validate

Same name in other branches
  1. 10 core/modules/file/src/Validation/UploadedFileValidator.php \Drupal\file\Validation\UploadedFileValidator::validate()

Overrides UploadedFileValidatorInterface::validate

File

core/modules/file/src/Validation/UploadedFileValidator.php, line 38

Class

UploadedFileValidator
Validator for uploaded files.

Namespace

Drupal\file\Validation

Code

public function validate(UploadedFile $uploadedFile, array $options = []) : ConstraintViolationListInterface {
    $constraint = new UploadedFileConstraint($options);
    return $this->getValidator()
        ->validate($uploadedFile, $constraint);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.