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

Breadcrumb

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

function Assert::minCount

Does not check if $array is countable, this can generate a warning on php versions after 7.2.

Parameters

Countable|array $array:

int|float $min:

string $message:

Throws

InvalidArgumentException

File

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

Class

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

Namespace

Webmozart\Assert

Code

public static function minCount($array, $min, $message = '') {
    if (\count($array) < $min) {
        static::reportInvalidArgument(\sprintf($message ?: 'Expected an array to contain at least %2$d elements. Got: %d', \count($array), $min));
    }
}

API Navigation

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