From 8d0c51d310aca4f82d746e66aee061a7ac8696fb Mon Sep 17 00:00:00 2001 From: Oleg Sherbakov Date: Tue, 11 Nov 2025 13:05:37 +0400 Subject: [PATCH] Quick fork of HttpClientFactory to use own HttpClient. --- src/HttpClients/HttpClientFactory.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/HttpClients/HttpClientFactory.php b/src/HttpClients/HttpClientFactory.php index 49b3ce5..5d4b5f8 100644 --- a/src/HttpClients/HttpClientFactory.php +++ b/src/HttpClients/HttpClientFactory.php @@ -43,6 +43,12 @@ public function createHttpClient($timeout = null, $handlerName = null) case 'stream': return new StreamHttpClient(new MindboxStream(), $timeout); default: + if (class_exists($handlerName) + && is_a($handlerName, CurlHttpClient::class, true) + ) { + return new $handlerName(new MindboxCurl(), $timeout); + } + throw new MindboxConfigException('The http client handler must be set to "curl", "stream"'); } }