Skip to content

Commit 3e25b9f

Browse files
committed
Merge pull request #19 from php-http/final
Make classes final
2 parents 8fc9328 + 4acafff commit 3e25b9f

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-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

+3-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,8 +75,10 @@ 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($client, RequestInterface $syncRequest, RequestInterface $asyncRequest)
8379
{
80+
$client->implement('Http\Client\HttpClient');
81+
$client->implement('Http\Client\HttpAsyncClient');
8482
$client->sendRequest($syncRequest)->shouldBeCalled();
8583
$client->sendRequest($asyncRequest)->shouldNotBeCalled();
8684
$client->sendAsyncRequest($asyncRequest)->shouldBeCalled();

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)