From 549491b6077575f5c9b1e9901c2bec8b09135610 Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Sun, 15 Sep 2024 20:12:27 +0200 Subject: [PATCH] prepare for version 2 of HttplugBundle --- integrations/symfony-bundle.rst | 8 ++++---- integrations/symfony-full-configuration.rst | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/integrations/symfony-bundle.rst b/integrations/symfony-bundle.rst index 5083e69..c531ddb 100644 --- a/integrations/symfony-bundle.rst +++ b/integrations/symfony-bundle.rst @@ -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 @@ -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 @@ -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 @@ -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); diff --git a/integrations/symfony-full-configuration.rst b/integrations/symfony-full-configuration.rst index b98fe11..95a6a91 100644 --- a/integrations/symfony-full-configuration.rst +++ b/integrations/symfony-full-configuration.rst @@ -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