-
Notifications
You must be signed in to change notification settings - Fork 46
Add Mock Client strategy. #90
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 1 commit
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,26 @@ | ||
<?php | ||
|
||
namespace Http\Discovery\Strategy; | ||
|
||
use Http\Mock\Client as Mock; | ||
|
||
/** | ||
* Find the Mock client. | ||
* | ||
* @internal | ||
* @final | ||
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. No need for final annotation 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. 👍 |
||
* | ||
* @author Sam Rapaport <[email protected]> | ||
*/ | ||
final class MockClientStrategy implements DiscoveryStrategy | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public static function getCandidates($type) | ||
{ | ||
return ($type === 'Http\Client\HttpClient') | ||
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. You could use the ::class constant here 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. Good call, changing that now. |
||
? ['class' => Mock::class, 'condition' => Mock::class] | ||
: []; | ||
} | ||
} |
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.
Is this strategy really internal? The others are, but it is meant that this class should be used by others, right?