wangchen147 295fb5d386 1.0.0
2024-04-03 15:26:01 +08:00

25 lines
625 B
PHP

<?php
declare(strict_types=1);
namespace Yansongda\Artful\Service;
use Yansongda\Artful\Artful;
use Yansongda\Artful\Contract\HttpClientFactoryInterface;
use Yansongda\Artful\Contract\ServiceProviderInterface;
use Yansongda\Artful\Exception\ContainerException;
use Yansongda\Artful\HttpClientFactory;
class HttpServiceProvider implements ServiceProviderInterface
{
/**
* @throws ContainerException
*/
public function register(mixed $data = null): void
{
$container = Artful::getContainer();
Artful::set(HttpClientFactoryInterface::class, new HttpClientFactory($container));
}
}