-
Notifications
You must be signed in to change notification settings - Fork 50
Deprecated HttpClient service, added ClientInterface #426
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.
thanks a lot!
As you can see this doesn't work with old symfony versions. Time to drop them, or would you rather remove "package" from here? |
this + add it as a comment in the xml 4.4 is still not EOL |
it's in security maintenance, which I consider EOL, similarly like people consider PHP 5.3 EOL while RHEL is still patching it. Most bundles dropped support of Symfony 4.4. Anyways I don't want to talk about it too much here, go either way here. |
i solved it like this in FOSHttpCacheBundle: https://github.com/FriendsOfSymfony/FOSHttpCacheBundle/blob/ef1bab770fbb2fc3f0f6a3e9c66dceb1cde58822/src/DependencyInjection/FOSHttpCacheExtension.php#L286 with https://github.com/FriendsOfSymfony/FOSHttpCacheBundle/blob/2.x/src/Resources/config/user_context_legacy_sf6.xml and https://github.com/FriendsOfSymfony/FOSHttpCacheBundle/blob/2.x/src/Resources/config/user_context_legacy.xml the idea is to extract the deprecated alias into its own service configuration file and have the extension include the variant that works for the symfony version that is used. (i would invert the naming to what we did in the bundle, something like httplug_alias.xml for the new syntax and httplug_alias_legacy.xml for old symfony versions) |
@@ -47,7 +47,10 @@ | |||
<service id="httplug.client.default" class="Http\Client\HttpClient"> | |||
<factory class="Http\Discovery\HttpClientDiscovery" method="find" /> | |||
</service> | |||
<service id="Http\Client\HttpClient" alias="httplug.client" public="false" /> | |||
<service id="Http\Client\HttpClient" alias="httplug.client" public="false"> | |||
<deprecated package="php-http/httplug-bundle" version="1.28" /> |
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.
<deprecated package="php-http/httplug-bundle" version="1.28" /> | |
<deprecated package="php-http/httplug-bundle" version="1.28">The "%service_id%" service is deprecated in favor of using PSR-7 Psr\Http\Client\ClientInterface directly</deprecated> |
Fixes #425
What's in this PR?
It deprecates exposing the deprecated
Http\Client\HttpClient
and adds default servicePsr\Http\Client\ClientInterface
.Why?
Example Usage
Checklist
To Do