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

Breadcrumb

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

function Assert::notInstanceOf

@psalm-pure @psalm-template ExpectedType of object @psalm-param class-string<ExpectedType> $class @psalm-assert !ExpectedType $value

Parameters

mixed $value:

string|object $class:

string $message:

Throws

InvalidArgumentException

File

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

Class

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

Namespace

Webmozart\Assert

Code

public static function notInstanceOf($value, $class, $message = '') {
    if ($value instanceof $class) {
        static::reportInvalidArgument(\sprintf($message ?: 'Expected an instance other than %2$s. Got: %s', static::typeToString($value), $class));
    }
}

API Navigation

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