Final Class Yiisoft\Hydrator\Attribute\Parameter\DiNotFoundException
| Inheritance | Yiisoft\Hydrator\Attribute\Parameter\DiNotFoundException » RuntimeException |
|---|---|
| Implements | Psr\Container\NotFoundExceptionInterface |
Exception that is thrown by {@see DiResolver} when an object is not found or object ID auto-resolving fails.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Hydrator\Attribute\Parameter\DiNotFoundException |
Method Details
| public mixed __construct ( ReflectionParameter|ReflectionProperty $reflection, Throwable|null $previous = null ) | ||
| $reflection | ReflectionParameter|ReflectionProperty |
Parameter or property reflection. |
| $previous | Throwable|null |
The previous throwable used for the exception chaining. |
public function __construct(ReflectionParameter|ReflectionProperty $reflection, ?Throwable $previous = null)
{
/**
* @psalm-suppress PossiblyNullReference $reflection->getDeclaringClass() always returns not null in this case.
*/
$className = $reflection->getDeclaringClass()->getName();
if ($reflection instanceof ReflectionParameter) {
$message = 'Constructor parameter "' . $reflection->getName() . '" of class "' . $className . '"';
} else {
$message = 'Class property "' . $className . '::$' . $reflection->getName() . '"';
}
$type = $reflection->getType();
$message .= $type === null
? ' without type'
: (' with type "' . $type . '"');
$message .= ' not resolved.';
parent::__construct($message, previous: $previous);
}
Signup or Login in order to comment.