Skip to content

Commit c8863d6

Browse files
committed
Make clients final
Make not-yet-released clients final Update changelog Remove TODOs in favor of #20
1 parent 8fc9328 commit c8863d6

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
- Add a flexible http client providing both contract, and only emulating what's necessary
88
- HTTP Client Router: route requests to underlying clients
99

10+
### Deprecated
11+
12+
- Extending client classes, they will be made final in version 2.0
13+
1014

1115
## 1.0.0 - 2016-01-27
1216

spec/FlexibleHttpClientSpec.php

+20-5
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22

33
namespace spec\Http\Client\Common;
44

5-
use Http\Client\Common\HttpAsyncClientDecorator;
6-
use Http\Client\Common\HttpClientDecorator;
7-
use Http\Client\Common\FlexibleHttpClient;
85
use Http\Client\HttpAsyncClient;
96
use Http\Client\HttpClient;
107
use Http\Promise\Promise;
118
use Psr\Http\Message\RequestInterface;
129
use Psr\Http\Message\ResponseInterface;
1310
use PhpSpec\ObjectBehavior;
14-
use Prophecy\Prophet;
1511

1612
class FlexibleHttpClientSpec extends ObjectBehavior
1713
{
@@ -79,7 +75,7 @@ function it_emulates_a_client(
7975
$this->sendRequest($syncRequest)->shouldReturn($syncResponse);
8076
}
8177

82-
function it_does_not_emulate_a_client(FlexibleHttpClient $client, RequestInterface $syncRequest, RequestInterface $asyncRequest)
78+
function it_does_not_emulate_a_client(CombinedHttpClient $client, RequestInterface $syncRequest, RequestInterface $asyncRequest)
8379
{
8480
$client->sendRequest($syncRequest)->shouldBeCalled();
8581
$client->sendRequest($asyncRequest)->shouldNotBeCalled();
@@ -92,3 +88,22 @@ function it_does_not_emulate_a_client(FlexibleHttpClient $client, RequestInterfa
9288
$this->sendAsyncRequest($asyncRequest);
9389
}
9490
}
91+
92+
class CombinedHttpClient implements HttpClient, HttpAsyncClient
93+
{
94+
/**
95+
* @param RequestInterface $request
96+
*/
97+
public function sendRequest(RequestInterface $request)
98+
{
99+
// TODO: Implement sendRequest() method.
100+
}
101+
102+
/**
103+
* @param RequestInterface $request
104+
*/
105+
public function sendAsyncRequest(RequestInterface $request)
106+
{
107+
// TODO: Implement sendAsyncRequest() method.
108+
}
109+
}

src/FlexibleHttpClient.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
* @author Joel Wurtz <[email protected]>
1313
*/
14-
class FlexibleHttpClient implements HttpClient, HttpAsyncClient
14+
final class FlexibleHttpClient implements HttpClient, HttpAsyncClient
1515
{
1616
use HttpClientDecorator;
1717
use HttpAsyncClientDecorator;

0 commit comments

Comments
 (0)