From a8fd62a67a85d596c75ef0f9e00eb404933c9b91 Mon Sep 17 00:00:00 2001 From: Quentin Dreyer Date: Sat, 30 Jul 2022 13:38:19 +0200 Subject: [PATCH] fix: allow configuration of php-http/socket-client >=2.0 --- src/Client.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Client.php b/src/Client.php index 902e3f9..8136f2e 100644 --- a/src/Client.php +++ b/src/Client.php @@ -48,15 +48,15 @@ class Client implements HttpClient * @var int $ssl_method Crypto method for ssl/tls, see PHP doc, defaults to STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT * } */ - public function __construct($config1 = [], $config2 = null, array $config = []) + public function __construct($configOrResponseFactory = [], array $config = []) { - if (\is_array($config1)) { - $this->config = $this->configure($config1); + if (\is_array($configOrResponseFactory)) { + $this->config = $this->configure($configOrResponseFactory); return; } - @trigger_error('Passing a Psr\Http\Message\ResponseFactoryInterface and a Psr\Http\Message\StreamFactoryInterface to SocketClient is deprecated, and will be removed in 3.0, you should only pass config options.', E_USER_DEPRECATED); + @trigger_error('Passing a Psr\Http\Message\ResponseFactoryInterface to SocketClient is deprecated, and will be removed in 3.0, you should only pass config options.', E_USER_DEPRECATED); $this->config = $this->configure($config); }