Skip to content

Final #19

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
Apr 2, 2016
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
- Add a flexible http client providing both contract, and only emulating what's necessary
- HTTP Client Router: route requests to underlying clients

### Deprecated

- Extending client classes, they will be made final in version 2.0


## 1.0.0 - 2016-01-27

Expand Down
8 changes: 3 additions & 5 deletions spec/FlexibleHttpClientSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

namespace spec\Http\Client\Common;

use Http\Client\Common\HttpAsyncClientDecorator;
use Http\Client\Common\HttpClientDecorator;
use Http\Client\Common\FlexibleHttpClient;
use Http\Client\HttpAsyncClient;
use Http\Client\HttpClient;
use Http\Promise\Promise;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use PhpSpec\ObjectBehavior;
use Prophecy\Prophet;

class FlexibleHttpClientSpec extends ObjectBehavior
{
Expand Down Expand Up @@ -79,8 +75,10 @@ function it_emulates_a_client(
$this->sendRequest($syncRequest)->shouldReturn($syncResponse);
}

function it_does_not_emulate_a_client(FlexibleHttpClient $client, RequestInterface $syncRequest, RequestInterface $asyncRequest)
function it_does_not_emulate_a_client($client, RequestInterface $syncRequest, RequestInterface $asyncRequest)
{
$client->implement('Http\Client\HttpClient');
$client->implement('Http\Client\HttpAsyncClient');
$client->sendRequest($syncRequest)->shouldBeCalled();
$client->sendRequest($asyncRequest)->shouldNotBeCalled();
$client->sendAsyncRequest($asyncRequest)->shouldBeCalled();
Expand Down
2 changes: 1 addition & 1 deletion src/FlexibleHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
* @author Joel Wurtz <[email protected]>
*/
class FlexibleHttpClient implements HttpClient, HttpAsyncClient
final class FlexibleHttpClient implements HttpClient, HttpAsyncClient
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we want to rename this to CombinedHttpClient now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know, rename is discussed in #16, although no better name came up yet IMO.

{
use HttpClientDecorator;
use HttpAsyncClientDecorator;
Expand Down