<?php

declare(strict_types=1);

namespace apexl\Io\modules\tabulator\Factories;

use apexl\Io\modules\tabulator\Controllers\TabulatorController;
use apexl\Io\modules\tabulator\Interfaces\HasTabulatorViewInterface;
use DI\Container;
use DI\DependencyException;
use DI\NotFoundException;

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

    /**
     * @throws DependencyException
     * @throws NotFoundException
     */
    public function make(HasTabulatorViewInterface $entity): TabulatorController
    {
        return $this->container->make(TabulatorController::class, ['entity' => $entity]);
    }
}