-
Notifications
You must be signed in to change notification settings - Fork 53
deprecate debug_plugin options #64
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
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 think we should keep the test. can we register a handler to not fail on deprecation?
spec/PluginClientSpec.php
Outdated
@@ -87,47 +87,4 @@ function it_throws_loop_exception(HttpClient $httpClient, RequestInterface $requ | |||
|
|||
$this->shouldThrow('Http\Client\Common\Exception\LoopException')->duringSendRequest($request); | |||
} | |||
|
|||
function it_injects_debug_plugins(HttpClient $httpClient, ResponseInterface $response, RequestInterface $request, Plugin $plugin0, Plugin $plugin1, Plugin $debugPlugin) |
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.
should we not continue to test this while its in the codebase?
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 didn't know why I removed this test... We must keep it as the feature is still present and still usable.
CHANGELOG.md
Outdated
### Deprecated | ||
|
||
- The `debug_plugins` option for `PluginClient` is deprecated and will be removed in 2.0. | ||
|
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.
would be cool to mention what to use instead
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.
Like "Use the decorator design pattern instead."?
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.
yep. and maybe point to one place where we do that ourselves as an illustration. thats a bit verbose for a changelog but i would prefer that over writing extensive upgrade guides...
All requested changes have been addressed. |
CHANGELOG.md
Outdated
|
||
### Deprecated | ||
|
||
- The `debug_plugins` option for `PluginClient` is deprecated and will be removed in 2.0. Use the decorator design pattern instead like in https://github.com/php-http/HttplugBundle/blob/master/Collector/ProfilePlugin.php. |
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.
Maybe use a markdown link here instead of the whole URL. Also, this is not a permanent link. A link with a commit hash in it might be better.
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.
when you are on a github page of the file, you can press the y
key to get the link with the last commit id.
src/PluginClient.php
Outdated
@@ -108,6 +108,10 @@ public function sendAsyncRequest(RequestInterface $request) | |||
*/ | |||
private function configure(array $options = []) | |||
{ | |||
if (isset($options['debug_plugins'])) { | |||
@trigger_error('The "debug_plugins" option is deprecated and will be removed in 2.0.', E_USER_DEPRECATED); |
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 would add deprecated since X.Y
here as we usually do.
Would be nice to have some docs about this, decorating all plugins manually can be painful an complicated. |
Thank you! |
What's in this PR?
The
PluginClient
now triggers a deprecation notice when thedebug_plugins
option is set.Why?
The
debug_plugins
option was used by the HttplugBundle collector, but since php-http/HttplugBundle#128 is merged, it's no longer required.