Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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