Skip to content

Commit 2d6cab3

Browse files
authored
Added info about the "service" key for the bundle (#230)
* Added info about the "service" key for the bundle * Added "versionadded"
1 parent 30e5809 commit 2d6cab3

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

integrations/symfony-bundle.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,20 @@ services are:
207207
* ``httplug.factory.socket``
208208
* ``httplug.factory.mock`` (Install ``php-http/mock-client`` first)
209209

210+
.. note::
211+
212+
.. versionadded:: 1.10
213+
214+
If you already have a client service registered you can skip using the ``factory``
215+
and use the ``service`` key instead.
216+
217+
.. code-block:: yaml
218+
219+
httplug:
220+
clients:
221+
my_client:
222+
service: 'my_custom_client_service'
223+
210224
Plugins
211225
```````
212226

@@ -366,7 +380,7 @@ To mock a response in your tests, do:
366380
367381
// If your test has the client (BrowserKit) make multiple requests, you need to disable reboot as the kernel is rebooted on each request.
368382
// $client->disableReboot();
369-
383+
370384
$response = $this->createMock('Psr\Http\Message\ResponseInterface');
371385
$response->method('getBody')->willReturn(/* Psr\Http\Message\Interface instance containing expected response content. */);
372386
$client->getContainer()->get('httplug.client.mock')->addResponse($response);

integrations/symfony-full-configuration.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ This page shows an example of all configuration values provided by the bundle.
7171
clients:
7272
acme:
7373
factory: 'httplug.factory.guzzle6'
74+
service: 'my_service' # Can not be used with "factory" or "config"
7475
flexible_client: false # Can only be true if http_methods_client is false
7576
http_methods_client: false # Can only be true if flexible_client is false
7677
config:

0 commit comments

Comments
 (0)