UploadedFileValidatorInterface.php

Same filename in other branches
  1. 10 core/modules/file/src/Validation/UploadedFileValidatorInterface.php

Namespace

Drupal\file\Validation

File

core/modules/file/src/Validation/UploadedFileValidatorInterface.php

View source
<?php

declare (strict_types=1);
namespace Drupal\file\Validation;

use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Validator\ConstraintViolationListInterface;

/**
 * Validator for uploaded files.
 */
interface UploadedFileValidatorInterface {
    
    /**
     * Validates an uploaded file.
     *
     * @param \Symfony\Component\HttpFoundation\File\UploadedFile $uploadedFile
     *   The uploaded file.
     * @param array $options
     *   An array of options accepted by
     *   \Drupal\file\Validation\Constraint\UploadedFileConstraint.
     *
     * @return \Symfony\Component\Validator\ConstraintViolationListInterface
     *   The constraint violation list.
     */
    public function validate(UploadedFile $uploadedFile, array $options = []) : ConstraintViolationListInterface;

}

Interfaces

Title Deprecated Summary
UploadedFileValidatorInterface Validator for uploaded files.

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