File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 8787 $request = $this->container->get('httplug.message_factory')->createRequest('GET', 'http://example.com');
8888 $response = $this->container->get('httplug.client.acme')->sendRequest($request);
8989
90- Autowiring the Default Client
91- -----------------------------
90+ Autowiring
91+ ----------
9292
9393The first configured client is considered the "default" client. It is available
9494for `autowiring `_ both for ``HttpClient `` and ``HttpAsyncClient ``. This can be
@@ -103,6 +103,18 @@ Therefore you can disable autowiring with a configuration option:
103103 httplug :
104104 default_client_autowiring : false
105105
106+ When using this bundle with Symfony 5.3 or newer, you can use the `#[Target] ` attribute to select a
107+ client by name:
108+
109+ .. code-block :: php
110+
111+ final class MyService
112+ {
113+ public function __construct(
114+ #[Target('acme')] HttpClient $client
115+ ) {}
116+ }
117+
106118 Web Debug Toolbar
107119`````````````````
108120.. image :: /assets/img/debug-toolbar.png
You can’t perform that action at this time.
0 commit comments