<?php
declare(strict_types=1);

namespace App\Utils\Transfer\HisSoapClient;
use App\Utils\Transfer\SoapTransferAbstract;

class ClientFactory
{

    /**
     * Get Client Transfer Class
     * @param string $name
     * @return SoapTransferAbstract
     */
    public static function getClientTransfer(string $name): SoapTransferAbstract
    {
        $is_mock = config('hisservice.'. $name. '.is_mock');

        return match ($is_mock) {
            false => new ClientSoapTransfer($name),
            true => new ClientMockSoapTransfer($name),
        };
    }
}