function Assert::isAOf
@psalm-pure @psalm-template ExpectedType of object @psalm-param class-string<ExpectedType> $class @psalm-assert ExpectedType|class-string<ExpectedType> $value
Parameters
object|string $value:
string $class:
string $message:
Throws
File
-
vendor/
webmozart/ assert/ src/ Assert.php, line 482
Class
- Assert
- Efficient assertions to validate the input/output of your methods.
Namespace
Webmozart\AssertCode
public static function isAOf($value, $class, $message = '') {
static::string($class, 'Expected class as a string. Got: %s');
if (!\is_a($value, $class, \is_string($value))) {
static::reportInvalidArgument(sprintf($message ?: 'Expected an instance of this class or to this class among its parents "%2$s". Got: %s', static::valueToString($value), $class));
}
}