Skip to content

Commit

Permalink
Merge pull request #58 from php-http/httplug2-cleanup
Browse files Browse the repository at this point in the history
simplify client now that we only support httplug 2
  • Loading branch information
dbu authored Aug 25, 2021
2 parents d8e200d + 89d8841 commit a797c2a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Http\Mock;

use Http\Client\Common\HttpAsyncClientEmulator;
use Http\Client\Common\VersionBridgeClient;
use Http\Client\Exception;
use Http\Client\HttpAsyncClient;
use Http\Client\HttpClient;
Expand All @@ -26,7 +25,6 @@
class Client implements HttpClient, HttpAsyncClient
{
use HttpAsyncClientEmulator;
use VersionBridgeClient;

/**
* @var ResponseFactory|ResponseFactoryInterface
Expand Down Expand Up @@ -78,9 +76,15 @@ public function __construct($responseFactory = null)
}

/**
* {@inheritdoc}
* Respond with the prepared behaviour, in the following order.
*
* - Throw the next exception in the list and advance
* - Return the next response in the list and advance
* - Throw the default exception if set (forever)
* - Return the default response if set (forever)
* - Create a new empty response with the response factory
*/
public function doSendRequest(RequestInterface $request)
public function sendRequest(RequestInterface $request): ResponseInterface
{
$this->requests[] = $request;

Expand Down

0 comments on commit a797c2a

Please sign in to comment.