-
Notifications
You must be signed in to change notification settings - Fork 6
Add request conditional plugin #65
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
Conversation
bd39a68
to
8035119
Compare
Applied fixes from StyleCI
8035119
to
53fd56d
Compare
* @param RequestMatcher $requestMatcher | ||
* @param Plugin $delegatedPlugin | ||
*/ | ||
public function __construct(RequestMatcher $requestMatcher, Plugin $delegatedPlugin) |
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.
I maybe want to use more than one plugin. I suggest allowing the second parameter to be an array of Plugins. Would that be possible?
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.
I was also thinking about that. For that case I would add a separate
ChainPlugin.
Tobias Nyholm [email protected] ezt írta (2016. március 5.,
szombat):
In src/RequestConditionalPlugin.php
#65 (comment):+{
- /**
\* @var RequestMatcher
*/
- private $requestMatcher;
- /**
\* @var Plugin
*/
- private $delegatedPlugin;
- /**
\* @param RequestMatcher $requestMatcher
\* @param Plugin $delegatedPlugin
*/
- public function __construct(RequestMatcher $requestMatcher, Plugin $delegatedPlugin)
I maybe want to use more than one plugin. I suggest allowing the second
parameter to be an array of Plugins. Would that be possible?—
Reply to this email directly or view it on GitHub
https://github.com/php-http/plugins/pull/65/files#r55119904.
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.
Okey. Cool!
Anyone review? |
use Psr\Http\Message\RequestInterface; | ||
|
||
/** | ||
* Apply a delegated plugin based on a request match. |
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.
Execute a plugin only if the RequestMatcher matches the request.
would this now need to go against client-commons, now that we move the plugins there? |
Yes, it should. Wanted to finish it before closing and moving to common. |
Update todo Remove options resolver dependency Revert: Remove options resolver dependency Add AddHostPlugin Add Authentication plugins Add content length plugin Add final warning to plugins Add cookie plugin Add decoder plugin Add error plugin Add header plugins Add history plugin Fix namespace import order Add redirect plugin Add retry plugin Make plugin classes final, related #18 Fix throw keyword Manually apply php-http/plugins#68 Manually apply and close php-http/plugins#65
Update todo Remove options resolver dependency Revert: Remove options resolver dependency Add AddHostPlugin Add Authentication plugins Add content length plugin Add final warning to plugins Add cookie plugin Add decoder plugin Add error plugin Add header plugins Add history plugin Fix namespace import order Add redirect plugin Add retry plugin Make plugin classes final, related #18 Fix throw keyword Manually apply php-http/plugins#68 Manually apply and close php-http/plugins#65
Update todo Remove options resolver dependency Revert: Remove options resolver dependency Add AddHostPlugin Add Authentication plugins Add content length plugin Add final warning to plugins Add cookie plugin Add decoder plugin Add error plugin Add header plugins Add history plugin Fix namespace import order Add redirect plugin Add retry plugin Make plugin classes final, related #18 Fix throw keyword Manually apply php-http/plugins#68 Manually apply and close php-http/plugins#65
Use case: cache certain responses based on a request condition.