<?php

namespace Openguru\OpenCartFramework\Migrations;

use Openguru\OpenCartFramework\Container\Container;
use Openguru\OpenCartFramework\Container\ServiceProvider;
use Psr\Log\LoggerInterface;
use Openguru\OpenCartFramework\QueryBuilder\Connections\ConnectionInterface;

class MigrationsServiceProvider extends ServiceProvider
{
    public function register(): void
    {
        $this->container->singleton(MigratorService::class, function (Container $app) {
            return new MigratorService(
                $app->get(ConnectionInterface::class),
                $app->get(LoggerInterface::class),
                database_path('migrations'),
            );
        });
    }
}
