interface FileValidatorInterface

Same name in other branches
  1. 11.x core/modules/file/src/Validation/FileValidatorInterface.php \Drupal\file\Validation\FileValidatorInterface

Provides a file validator that supports a list of validations.

Hierarchy

Expanded class hierarchy of FileValidatorInterface

All classes that implement FileValidatorInterface

6 files declare their use of FileValidatorInterface
CKEditor5ImageController.php in core/modules/ckeditor5/src/Controller/CKEditor5ImageController.php
FileUploadHandler.php in core/modules/file/src/Upload/FileUploadHandler.php
FileUploadResource.php in core/modules/file/src/Plugin/rest/resource/FileUploadResource.php
FileValidationConstraintValidator.php in core/modules/file/src/Plugin/Validation/Constraint/FileValidationConstraintValidator.php
FileValidatorTestBase.php in core/modules/file/tests/src/Kernel/Validation/FileValidatorTestBase.php

... See full list

File

core/modules/file/src/Validation/FileValidatorInterface.php, line 11

Namespace

Drupal\file\Validation
View source
interface FileValidatorInterface {
    
    /**
     * Validates a File with a list of validators.
     *
     * @param \Drupal\file\FileInterface $file
     *   The file to validate.
     * @param array $validators
     *   An associative array of validators with:
     *   - key: the plugin ID of the file validation constraint.
     *   - value: an associative array of options to pass to the constraint.
     *
     * @return \Symfony\Component\Validator\ConstraintViolationListInterface
     *   The violations list.
     */
    public function validate(FileInterface $file, array $validators) : ConstraintViolationListInterface;

}

Members

Title Sort descending Modifiers Object type Summary
FileValidatorInterface::validate public function Validates a File with a list of validators.

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