<?php

declare(strict_types=1);

namespace apexl\Io\modules\mirror\Factory;

use apexl\Io\modules\mirror\Interface\UploaderServiceInterface;
use DI\Container;
use DI\DependencyException;
use DI\NotFoundException;
use function apexl\Io\assertInstanceOf;

final readonly class UploaderServiceFactory
{
    public function __construct(private Container $container) {}

    /**
     * @param class-string<UploaderServiceInterface> $class
     * @throws DependencyException
     * @throws NotFoundException
     */
    public function make(string $class): UploaderServiceInterface
    {
        assertInstanceOf($class, UploaderServiceInterface::class);

        return $this->container->get($class);
    }
}