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

Breadcrumb

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

function Assert::__callStatic

Throws

BadMethodCallException

File

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

Class

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

Namespace

Webmozart\Assert

Code

public static function __callStatic($name, $arguments) {
    if ('nullOr' === \substr($name, 0, 6)) {
        if (null !== $arguments[0]) {
            $method = \lcfirst(\substr($name, 6));
            \call_user_func_array(array(
                static::class,
                $method,
            ), $arguments);
        }
        return;
    }
    if ('all' === \substr($name, 0, 3)) {
        static::isIterable($arguments[0]);
        $method = \lcfirst(\substr($name, 3));
        $args = $arguments;
        foreach ($arguments[0] as $entry) {
            $args[0] = $entry;
            \call_user_func_array(array(
                static::class,
                $method,
            ), $args);
        }
        return;
    }
    throw new BadMethodCallException('No such method: ' . $name);
}
RSS feed
Powered by Drupal