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

Breadcrumb

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

function Assert::isIterable

@psalm-pure @psalm-assert iterable $value

Parameters

mixed $value:

string $message:

Throws

InvalidArgumentException

1 call to Assert::isIterable()
Assert::__callStatic in vendor/webmozart/assert/src/Assert.php

File

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

Class

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

Namespace

Webmozart\Assert

Code

public static function isIterable($value, $message = '') {
    if (!\is_array($value) && !$value instanceof Traversable) {
        static::reportInvalidArgument(\sprintf($message ?: 'Expected an iterable. Got: %s', static::typeToString($value)));
    }
}

API Navigation

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