From 89d88411e4b09a609a064e0d2cd206d1c281364c Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Wed, 25 Aug 2021 08:56:53 +0200 Subject: [PATCH] simplify client now that we only support httplug 2 --- src/Client.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Client.php b/src/Client.php index 7f6a606..e10890a 100644 --- a/src/Client.php +++ b/src/Client.php @@ -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; @@ -26,7 +25,6 @@ class Client implements HttpClient, HttpAsyncClient { use HttpAsyncClientEmulator; - use VersionBridgeClient; /** * @var ResponseFactory|ResponseFactoryInterface @@ -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;