protected function assertType(string $class, string $param, ?\ReflectionType $reflType): void
    {
        if ($reflType === null || !$reflType instanceof \ReflectionNamedType) {
            throw new AutowireException("Unable to autowire {$class}: Unknown type for parameter '{$param}'.");
        }

        if ($reflType->isBuiltin()) {
            throw new AutowireException("Unable to autowire {$class}: "
                . "Build-in type '" . $reflType->getName() . "' for parameter '{$param}' can't be used as container "
                . "id. Please use annotations.");
        }
    }