Final Class Yiisoft\Validator\Exception\RuleHandlerInterfaceNotImplementedException
| Inheritance | Yiisoft\Validator\Exception\RuleHandlerInterfaceNotImplementedException » RuntimeException |
|---|
An exception used by {@see RuleHandlerResolverInterface} implementations (e. g., {@see RuleHandlerContainer}) for the case when a retrieved value is not an object or an object that does not implement {@see RuleHandlerInterface}.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Validator\Exception\RuleHandlerInterfaceNotImplementedException |
Method Details
| public mixed __construct ( mixed $value, integer $code = 0, Throwable|null $previous = null ) | ||
| $value | mixed | |
| $code | integer | |
| $previous | Throwable|null | |
public function __construct(
/**
* @param mixed A variable retrieved from the container.
*/
mixed $value,
/**
* @var int The Exception code.
*/
int $code = 0,
/**
* @var Throwable|null The previous throwable used for the exception chaining.
*/
?Throwable $previous = null,
) {
$type = get_debug_type($value);
parent::__construct(
sprintf(
class_exists($type)
? 'Handler "%1$s" must implement "%2$s".'
: 'Expected instance of "%2$s". Got "%1$s".',
$type,
RuleHandlerInterface::class,
),
$code,
$previous,
);
}
Signup or Login in order to comment.