Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

Commit a009764

Browse files
committed
Require a response factory
1 parent 3e0bed6 commit a009764

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Change Log
22

33

4+
## UNRELEASED
5+
6+
### Changed
7+
8+
- Client now requires a Response factory instead of a Message factory
9+
10+
411
## 0.6.0 - 2016-06-27
512

613
### Changed

src/Client.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use GuzzleHttp\Message\ResponseInterface as GuzzleResponse;
99
use Http\Client\HttpClient;
1010
use Http\Discovery\MessageFactoryDiscovery;
11-
use Http\Message\MessageFactory;
11+
use Http\Message\ResponseFactory;
1212
use Psr\Http\Message\RequestInterface;
1313
use Psr\Http\Message\ResponseInterface;
1414
use Http\Client\Exception as HttplugException;
@@ -26,18 +26,18 @@ class Client implements HttpClient
2626
private $client;
2727

2828
/**
29-
* @var MessageFactory
29+
* @var ResponseFactory
3030
*/
31-
private $messageFactory;
31+
private $responseFactory;
3232

3333
/**
3434
* @param ClientInterface|null $client
35-
* @param MessageFactory|null $messageFactory
35+
* @param ResponseFactory|null $responseFactory
3636
*/
37-
public function __construct(ClientInterface $client = null, MessageFactory $messageFactory = null)
37+
public function __construct(ClientInterface $client = null, ResponseFactory $responseFactory = null)
3838
{
3939
$this->client = $client ?: new GuzzleClient();
40-
$this->messageFactory = $messageFactory ?: MessageFactoryDiscovery::find();
40+
$this->responseFactory = $responseFactory ?: MessageFactoryDiscovery::find();
4141
}
4242

4343
/**
@@ -92,7 +92,7 @@ private function createResponse(GuzzleResponse $response)
9292
{
9393
$body = $response->getBody();
9494

95-
return $this->messageFactory->createResponse(
95+
return $this->responseFactory->createResponse(
9696
$response->getStatusCode(),
9797
null,
9898
$response->getHeaders(),

0 commit comments

Comments
 (0)