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.
25 lines
567 B
25 lines
567 B
<?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),
|
|
};
|
|
}
|
|
}
|
|
|