Skip to content

Commit a959281

Browse files
committed
Use FlexibleClient
1 parent 7855a15 commit a959281

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

Collector/ProfileClient.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,18 @@ class ProfileClient implements HttpClient, HttpAsyncClient
4747
private $eventNames = [];
4848

4949
/**
50-
* @param HttpClient|HttpAsyncClient $client The client to profile. Client must implement both HttpClient and
51-
* HttpAsyncClient interfaces.
50+
* @param HttpClient|HttpAsyncClient $client The client to profile. Client must implement both HttpClient or
51+
* HttpAsyncClient interface.
5252
* @param Collector $collector
5353
* @param Formatter $formatter
5454
* @param Stopwatch $stopwatch
5555
*/
5656
public function __construct($client, Collector $collector, Formatter $formatter, Stopwatch $stopwatch)
5757
{
5858
if (!($client instanceof HttpClient && $client instanceof HttpAsyncClient)) {
59-
throw new \RuntimeException(sprintf(
60-
'%s first argument must implement %s and %s. Consider using %s.',
61-
__METHOD__,
62-
HttpClient::class,
63-
HttpAsyncClient::class,
64-
FlexibleHttpClient::class
65-
));
59+
$client = new FlexibleHttpClient($client);
6660
}
61+
6762
$this->client = $client;
6863
$this->collector = $collector;
6964
$this->formatter = $formatter;

0 commit comments

Comments
 (0)