-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Add autowiring for HTTPlug #32104
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
Add autowiring for HTTPlug #32104
Conversation
nicolas-grekas
commented
Jun 19, 2019
•
edited
Loading
edited
Q | A |
---|---|
Branch? | 4.4 |
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | - |
License | MIT |
Doc PR | symfony/symfony-docs#11820 |
Not a big fan of having HttpPlug code in FWB. It should be in a bridge/bundle, but not in the framework which is only about our code. |
3a67a9e
to
0429593
Compare
I removed the named autowiring aliases because they make no sense actually - nobody should code against HTTPlug anymore. I considered moving this to a recipe, but it would need two packages to be applicable (php-http/httplug and symfony/http-client), so that we cannot have one that fits both conditions. Creating a pack would make no sense since the goal of HTTPlug its to fade out now that PSR18 is released. Moving HttplugClient to the php-http org is possible. |
2bdfb41
to
21ed826
Compare
@@ -22,5 +22,11 @@ | |||
<argument type="service" id="Psr\Http\Message\StreamFactoryInterface" on-invalid="ignore" /> | |||
</service> | |||
<service id="Psr\Http\Client\ClientInterface" alias="psr18.http_client" /> | |||
|
|||
<service id="Http\Client\HttpClient" class="Symfony\Component\HttpClient\HttplugClient"> |
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.
not an alias so that it's not listed in debug:autowiring - no need to promote the alias for autowiring
->setAutowired(true) | ||
->setArguments([new Reference($name)]); | ||
$container->setDefinition('psr18.'.$name, new ChildDefinition('psr18.http_client')) | ||
->replaceArgument(0, new Reference($name)); |
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.
this change is not related to httplug - it's just better way to wire the psr18 named aliases
21ed826
to
f76e77d
Compare
Thank you @nicolas-grekas. |
This PR was merged into the 4.4 branch. Discussion ---------- Add autowiring for HTTPlug | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- f76e77d Add autowiring for HTTPlug