Skip to content

simplify client now that we only support httplug 2 #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 25, 2021
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