Skip to content

Commit a797c2a

Browse files
authored
Merge pull request #58 from php-http/httplug2-cleanup
simplify client now that we only support httplug 2
2 parents d8e200d + 89d8841 commit a797c2a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Client.php

+8-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Http\Mock;
44

55
use Http\Client\Common\HttpAsyncClientEmulator;
6-
use Http\Client\Common\VersionBridgeClient;
76
use Http\Client\Exception;
87
use Http\Client\HttpAsyncClient;
98
use Http\Client\HttpClient;
@@ -26,7 +25,6 @@
2625
class Client implements HttpClient, HttpAsyncClient
2726
{
2827
use HttpAsyncClientEmulator;
29-
use VersionBridgeClient;
3028

3129
/**
3230
* @var ResponseFactory|ResponseFactoryInterface
@@ -78,9 +76,15 @@ public function __construct($responseFactory = null)
7876
}
7977

8078
/**
81-
* {@inheritdoc}
79+
* Respond with the prepared behaviour, in the following order.
80+
*
81+
* - Throw the next exception in the list and advance
82+
* - Return the next response in the list and advance
83+
* - Throw the default exception if set (forever)
84+
* - Return the default response if set (forever)
85+
* - Create a new empty response with the response factory
8286
*/
83-
public function doSendRequest(RequestInterface $request)
87+
public function sendRequest(RequestInterface $request): ResponseInterface
8488
{
8589
$this->requests[] = $request;
8690

0 commit comments

Comments
 (0)