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 87
87
$request = $this->container->get('httplug.message_factory')->createRequest('GET', 'http://example.com');
88
88
$response = $this->container->get('httplug.client.acme')->sendRequest($request);
89
89
90
- Autowiring the Default Client
91
- -----------------------------
90
+ Autowiring
91
+ ----------
92
92
93
93
The first configured client is considered the "default" client. It is available
94
94
for `autowiring `_ both for ``HttpClient `` and ``HttpAsyncClient ``. This can be
@@ -103,6 +103,18 @@ Therefore you can disable autowiring with a configuration option:
103
103
httplug :
104
104
default_client_autowiring : false
105
105
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
+
106
118
Web Debug Toolbar
107
119
`````````````````
108
120
.. image :: /assets/img/debug-toolbar.png
You can’t perform that action at this time.
0 commit comments