Skip to content

Commit

Permalink
prepare for version 2 of HttplugBundle
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Sep 15, 2024
1 parent a440713 commit 549491b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions integrations/symfony-bundle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Usage
.. code-block:: php
$request = $this->container->get('httplug.psr17_request_factory')->createRequest('GET', 'http://example.com');
$request = $this->container->get(\Psr\Http\Message\RequestFactoryInterface::class)->createRequest('GET', 'http://example.com');
$response = $this->container->get('httplug.client.acme')->sendRequest($request);
Autowiring
Expand Down Expand Up @@ -205,7 +205,7 @@ the value of ``discovery.client`` to ``false``.
Discovery of Factory Classes
````````````````````````````

You need to specify all the factory classes for you client. The following
You can specify all the factory classes for you client. The following
example shows how you configure factory classes using Guzzle:

.. code-block:: yaml
Expand Down Expand Up @@ -250,7 +250,7 @@ services.
$httpClient = $this->container->get('httplug.client.acme');
// will be the same as ``httplug.client.my_guzzle7``
$httpClient = $this->container->get('httplug.client');
$httpClient = $this->container->get(\Psr\Http\Client\ClientInterface::class);
The bundle has client factory services that you can use to build your client.
If you need a very custom made client you could create your own factory service
Expand Down Expand Up @@ -562,7 +562,7 @@ To mock a response in your tests, do:
// If your test has the client (BrowserKit) make multiple requests, you need to disable reboot as the kernel is rebooted on each request.
// $client->disableReboot();
$response = $this->createMock('Psr\Http\Message\ResponseInterface');
$response = $this->createMock(Psr\\Http\Message\ResponseInterface:class);
$response->method('getBody')->willReturn(/* Psr\Http\Message\Interface instance containing expected response content. */);
$client->getContainer()->get('httplug.clients.my_awesome_backend.client')->addResponse($response);
Expand Down
2 changes: 1 addition & 1 deletion integrations/symfony-full-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ This page shows an example of all configuration values provided by the bundle.
stream_factory: 'httplug.stream_factory'
config:
default_ttl: 3600
respect_cache_headers: true
respect_response_cache_directives: ['no-cache', 'private', 'max-age', 'no-store']
cache_key_generator: null # This must be a service id to a service implementing 'Http\Client\Common\Plugin\Cache\Generator\CacheKeyGenerator'. If 'null' 'Http\Client\Common\Plugin\Cache\Generator\SimpleGenerator' will be used.
cookie:
cookie_jar: my_cookie_jar
Expand Down

0 comments on commit 549491b

Please sign in to comment.