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

Breadcrumb

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

function Assert::isInstanceOf

Same name in this branch
  1. 11.1.x vendor/phpunit/phpunit/src/Framework/Assert.php \PHPUnit\Framework\Assert::isInstanceOf()

@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

12 calls to Assert::isInstanceOf()
ExtendsFactory::create in vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/ExtendsFactory.php
ImplementsFactory::create in vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/ImplementsFactory.php
MethodFactory::create in vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/MethodFactory.php
PropertyFactory::create in vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/PropertyFactory.php
PropertyReadFactory::create in vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/PropertyReadFactory.php

... See full list

File

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

Class

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

Namespace

Webmozart\Assert

Code

public static function isInstanceOf($value, $class, $message = '') {
    if (!$value instanceof $class) {
        static::reportInvalidArgument(\sprintf($message ?: 'Expected an instance of %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