function InvalidArgumentException::fromNonExistingClass
1 call to InvalidArgumentException::fromNonExistingClass()
- Instantiator::getReflectionClass in vendor/
doctrine/ instantiator/ src/ Doctrine/ Instantiator/ Instantiator.php - @phpstan-param class-string<T> $className
File
-
vendor/
doctrine/ instantiator/ src/ Doctrine/ Instantiator/ Exception/ InvalidArgumentException.php, line 19
Class
- InvalidArgumentException
- Exception for invalid arguments provided to the instantiator
Namespace
Doctrine\Instantiator\ExceptionCode
public static function fromNonExistingClass(string $className) : self {
if (interface_exists($className)) {
return new self(sprintf('The provided type "%s" is an interface, and cannot be instantiated', $className));
}
if (trait_exists($className)) {
return new self(sprintf('The provided type "%s" is a trait, and cannot be instantiated', $className));
}
return new self(sprintf('The provided class "%s" does not exist', $className));
}