-
Notifications
You must be signed in to change notification settings - Fork 46
Add http async client discovery #16
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace spec\Http\Discovery; | ||
|
||
use PhpSpec\ObjectBehavior; | ||
|
||
class HttpAsyncClientDiscoverySpec extends ObjectBehavior | ||
{ | ||
function it_is_initializable() | ||
{ | ||
$this->shouldHaveType('Http\Discovery\HttpAsyncClientDiscovery'); | ||
} | ||
|
||
function it_is_a_class_discovery() | ||
{ | ||
$this->shouldHaveType('Http\Discovery\ClassDiscovery'); | ||
} | ||
|
||
function it_finds_an_http_client() | ||
{ | ||
$this->find()->shouldImplement('Http\Client\HttpAsyncClient'); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace Http\Discovery; | ||
|
||
use Http\Client\HttpAsyncClient; | ||
|
||
/** | ||
* Finds an HTTP Asynchronous Client | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Async term should be consistent |
||
* | ||
* @author Joel Wurtz <[email protected]> | ||
*/ | ||
class HttpAsyncClientDiscovery extends ClassDiscovery | ||
{ | ||
/** | ||
* @var HttpAsyncClient | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be imported? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be good There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean the class There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. with a use ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, otherwise IDEs won't find it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Like i said it's done, github just don't show it here :) as it's from a old commit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, great. |
||
*/ | ||
protected static $cache; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
protected static $classes = [ | ||
'guzzle6' => [ | ||
'class' => 'Http\Adapter\Guzzle6HttpAdapter', | ||
'condition' => 'Http\Adapter\Guzzle6HttpAdapter', | ||
], | ||
]; | ||
|
||
/** | ||
* Finds an HTTP Async Client | ||
* | ||
* @return HttpAsyncClient | ||
* | ||
* @throws NotFoundException | ||
*/ | ||
public static function find() | ||
{ | ||
// Override only used for return type declaration | ||
return parent::find(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
poke @sagikazarmark
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't see it.