Final Class Yiisoft\Yii\Cycle\Exception\NotInstantiableClassException
| Inheritance | Yiisoft\Yii\Cycle\Exception\NotInstantiableClassException » Exception |
|---|---|
| Implements | Psr\Container\ContainerExceptionInterface, Yiisoft\FriendlyException\FriendlyExceptionInterface |
Public Methods
Method Details
| public mixed __construct ( string $class, string|null $message = null, integer $code = 0, Exception|null $previous = null ) | ||
| $class | string | |
| $message | string|null | |
| $code | integer | |
| $previous | Exception|null | |
#[Pure]
public function __construct(string $class, ?string $message = null, int $code = 0, ?Exception $previous = null)
{
if ($message === null) {
$message = sprintf(
'Can not instantiate "%s" because it is not a subclass of "%s".',
$class,
RepositoryInterface::class
);
}
parent::__construct($message, $code, $previous);
}
| public string getName ( ) |
#[\Override]
public function getName(): string
{
return 'Repository not instantiable';
}
| public string|null getSolution ( ) |
#[\Override]
public function getSolution(): ?string
{
return 'Make sure that the class is instantiable and implements ' . RepositoryInterface::class;
}
Signup or Login in order to comment.