We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09979e6 commit 07ce778Copy full SHA for 07ce778
src/FlexibleHttpClient.php
@@ -30,15 +30,7 @@ public function __construct($client)
30
);
31
}
32
33
- $this->httpClient = $client;
34
- $this->httpAsyncClient = $client;
35
-
36
- if (!($this->httpClient instanceof ClientInterface)) {
37
- $this->httpClient = new EmulatedHttpClient($this->httpClient);
38
- }
39
40
- if (!($this->httpAsyncClient instanceof HttpAsyncClient)) {
41
- $this->httpAsyncClient = new EmulatedHttpAsyncClient($this->httpAsyncClient);
42
+ $this->httpClient = $client instanceof ClientInterface ? $client : new EmulatedHttpClient($client);
+ $this->httpAsyncClient = $client instanceof HttpAsyncClient ? $client : new EmulatedHttpAsyncClient($client);
43
44
0 commit comments