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

Breadcrumb

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

function NotBlank::__construct

Parameters

array<string,mixed>|null $options:

bool|null $allowNull Whether to allow null values (defaults to false):

string[]|null $groups:

Overrides Constraint::__construct

File

vendor/symfony/validator/Constraints/NotBlank.php, line 42

Class

NotBlank
Validates that a value is not blank.

Namespace

Symfony\Component\Validator\Constraints

Code

public function __construct(?array $options = null, ?string $message = null, ?bool $allowNull = null, ?callable $normalizer = null, ?array $groups = null, mixed $payload = null) {
    parent::__construct($options ?? [], $groups, $payload);
    $this->message = $message ?? $this->message;
    $this->allowNull = $allowNull ?? $this->allowNull;
    $this->normalizer = $normalizer ?? $this->normalizer;
    if (null !== $this->normalizer && !\is_callable($this->normalizer)) {
        throw new InvalidArgumentException(\sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer)));
    }
}

API Navigation

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