You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
567 B
26 lines
567 B
3 weeks ago
|
<?php
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
namespace App\Utils\Transfer\HisHttpClient;
|
||
|
|
||
|
use App\Utils\Transfer\HttpTransferAbstract;
|
||
|
|
||
|
class ClientFactory
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* Get Client Transfer Class
|
||
|
* @param string $name
|
||
|
* @return HttpTransferAbstract
|
||
|
*/
|
||
|
public static function getClientTransfer(string $name): HttpTransferAbstract
|
||
|
{
|
||
|
$is_mock = config('hisservice.'. $name. '.is_mock');
|
||
|
|
||
|
return match ($is_mock) {
|
||
|
false => new ClientHttpTransfer($name),
|
||
|
true => new ClientMockHttpTransfer($name),
|
||
|
};
|
||
|
}
|
||
|
}
|