function FileEncodingConstraint::__construct

Attributes

#[HasNamedArguments]

File

core/modules/file/src/Plugin/Validation/Constraint/FileEncodingConstraint.php, line 28

Class

FileEncodingConstraint
Defines an encoding constraint for files.

Namespace

Drupal\file\Plugin\Validation\Constraint

Code

public function __construct(mixed $options = NULL, ?array $encodings = NULL, public string $message = "The file is encoded with %detected. It must be encoded with %encoding", ?array $groups = NULL, mixed $payload = NULL) {
  parent::__construct($options, $groups, $payload);
  $this->encodings = $encodings ?? $this->encodings;
}

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