FileEncodingConstraint.php

Namespace

Drupal\file\Plugin\Validation\Constraint

File

core/modules/file/src/Plugin/Validation/Constraint/FileEncodingConstraint.php

View source
<?php

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

use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Validation\Attribute\Constraint;
use Symfony\Component\Validator\Constraint as SymfonyConstraint;

/**
 * Defines an encoding constraint for files.
 */
class FileEncodingConstraint extends SymfonyConstraint {
    
    /**
     * The error message.
     *
     * @var string
     */
    public string $message = "The file is encoded with %detected. It must be encoded with %encoding";
    
    /**
     * The allowed file encodings.
     *
     * @var array
     */
    public array $encodings;

}

Classes

Title Deprecated Summary
FileEncodingConstraint Defines an encoding constraint for files.

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