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

Breadcrumb

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

function Assert::notEmpty

@psalm-pure @psalm-assert !empty $value

Parameters

mixed $value:

string $message:

Throws

InvalidArgumentException

2 calls to Assert::notEmpty()
Assert::isNonEmptyList in vendor/webmozart/assert/src/Assert.php
@psalm-pure @psalm-assert non-empty-list $array
Assert::isNonEmptyMap in vendor/webmozart/assert/src/Assert.php
@psalm-pure @psalm-template T @psalm-param mixed|array<T> $array @psalm-assert array<string, T> $array @psalm-assert !empty $array

File

vendor/webmozart/assert/src/Assert.php, line 576

Class

Assert
Efficient assertions to validate the input/output of your methods.

Namespace

Webmozart\Assert

Code

public static function notEmpty($value, $message = '') {
    if (empty($value)) {
        static::reportInvalidArgument(\sprintf($message ?: 'Expected a non-empty value. Got: %s', static::valueToString($value)));
    }
}

API Navigation

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