0 follower

Final Class Yiisoft\Hydrator\Attribute\Parameter\DiNotFoundException

InheritanceYiisoft\Hydrator\Attribute\Parameter\DiNotFoundException » RuntimeException
ImplementsPsr\Container\NotFoundExceptionInterface

Exception that is thrown by {@see DiResolver} when an object is not found or object ID auto-resolving fails.

Method Details

Hide inherited methods

__construct() public method

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);
}