<?php

namespace Daniv04\HaciendaPackage\Services\Providers;
use Daniv04\HaciendaPackage\Providers\Contracts\ProviderInterface;
use Daniv04\HaciendaPackage\Providers\Cyberfuel\CyberfuelProvider;
use Daniv04\HaciendaPackage\Providers\Hacienda\HaciendaProvider;

class ProviderFactoryService
{
    public static function getProviderInstance(string $provider) : ProviderInterface
    {
        return match($provider) {
            'cyberfuel' => app(CyberfuelProvider::class),
            'hacienda' => app(HaciendaProvider::class),
            'mythicbyte' => app(HaciendaProvider::class), // Alias for backward compatibility
            default => throw new \InvalidArgumentException("Provider not found: $provider"),
        };
    }
}