function FileExtensionConstraint::__construct

Same name and namespace in other branches
  1. 11.x core/modules/file/src/Plugin/Validation/Constraint/FileExtensionConstraint.php \Drupal\file\Plugin\Validation\Constraint\FileExtensionConstraint::__construct()

File

core/modules/file/src/Plugin/Validation/Constraint/FileExtensionConstraint.php, line 21

Class

FileExtensionConstraint
File extension constraint.

Namespace

Drupal\file\Plugin\Validation\Constraint

Code

public function __construct(public string $extensions, public string $message = 'Only files with the following extensions are allowed: %files-allowed.', ?array $groups = NULL, mixed $payload = NULL) {
  parent::__construct(groups: $groups, payload: $payload);
}

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