Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare for version 2 of HttplugBundle #324

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading