Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Charset.php

function Charset::__construct

Overrides Constraint::__construct

File

vendor/symfony/validator/Constraints/Charset.php, line 30

Class

Charset
@author Alexandre Daubois <alex.daubois@gmail.com>

Namespace

Symfony\Component\Validator\Constraints

Code

public function __construct(array|string $encodings = [], string $message = 'The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}.', ?array $groups = null, mixed $payload = null) {
    parent::__construct(null, $groups, $payload);
    if ([] === $this->encodings) {
        throw new ConstraintDefinitionException(\sprintf('The "%s" constraint requires at least one encoding.', static::class));
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal