仓库初始化

This commit is contained in:
2025-08-13 10:43:56 +08:00
commit e8f9b46680
5180 changed files with 859303 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace Yansongda\Pay\Service;
use GuzzleHttp\Client;
use Yansongda\Pay\Contract\ConfigInterface;
use Yansongda\Pay\Contract\HttpClientInterface;
use Yansongda\Pay\Contract\ServiceProviderInterface;
use Yansongda\Pay\Exception\ContainerException;
use Yansongda\Pay\Exception\ServiceNotFoundException;
use Yansongda\Pay\Pay;
use Yansongda\Supports\Config;
class HttpServiceProvider implements ServiceProviderInterface
{
/**
* @param mixed $data
*
* @throws ContainerException
* @throws ServiceNotFoundException
*/
public function register($data = null): void
{
/* @var Config $config */
$config = Pay::get(ConfigInterface::class);
if (class_exists(Client::class)) {
$service = new Client($config->get('http', []));
Pay::set(HttpClientInterface::class, $service);
}
}
}