Skip to content

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

Merged
merged 1 commit into from
Apr 3, 2017
Merged

deprecate debug_plugin options #64

merged 1 commit into from
Apr 3, 2017

Conversation

fbourigault
Copy link
Contributor

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Related tickets fixes #60
Documentation N/A
License MIT

What's in this PR?

The PluginClient now triggers a deprecation notice when the debug_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.

Copy link
Contributor

@dbu dbu left a 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?

@@ -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)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

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."?

Copy link
Contributor

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...

@fbourigault
Copy link
Contributor Author

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.
Copy link
Member

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.

Copy link
Contributor

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.

@@ -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);
Copy link
Member

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.

@sagikazarmark
Copy link
Member

Would be nice to have some docs about this, decorating all plugins manually can be painful an complicated.

@Nyholm
Copy link
Member

Nyholm commented Apr 3, 2017

Thank you!

@Nyholm Nyholm merged commit 025f176 into php-http:master Apr 3, 2017
@fbourigault fbourigault deleted the deprecate-debug-plugins branch April 3, 2017 12:50
@fbourigault fbourigault mentioned this pull request May 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC] Deprecate PluginClient debug_plugins option
4 participants