|
84 | 84 |
|
85 | 85 | .. code-block:: php |
86 | 86 |
|
87 | | - $request = $this->container->get('httplug.psr17_request_factory')->createRequest('GET', 'http://example.com'); |
| 87 | + $request = $this->container->get(\Psr\Http\Message\RequestFactoryInterface::class)->createRequest('GET', 'http://example.com'); |
88 | 88 | $response = $this->container->get('httplug.client.acme')->sendRequest($request); |
89 | 89 |
|
90 | 90 | Autowiring |
@@ -205,7 +205,7 @@ the value of ``discovery.client`` to ``false``. |
205 | 205 | Discovery of Factory Classes |
206 | 206 | ```````````````````````````` |
207 | 207 |
|
208 | | -You need to specify all the factory classes for you client. The following |
| 208 | +You can specify all the factory classes for you client. The following |
209 | 209 | example shows how you configure factory classes using Guzzle: |
210 | 210 |
|
211 | 211 | .. code-block:: yaml |
@@ -250,7 +250,7 @@ services. |
250 | 250 | $httpClient = $this->container->get('httplug.client.acme'); |
251 | 251 |
|
252 | 252 | // will be the same as ``httplug.client.my_guzzle7`` |
253 | | - $httpClient = $this->container->get('httplug.client'); |
| 253 | + $httpClient = $this->container->get(\Psr\Http\Client\ClientInterface::class); |
254 | 254 |
|
255 | 255 | The bundle has client factory services that you can use to build your client. |
256 | 256 | 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: |
562 | 562 | // If your test has the client (BrowserKit) make multiple requests, you need to disable reboot as the kernel is rebooted on each request. |
563 | 563 | // $client->disableReboot(); |
564 | 564 |
|
565 | | - $response = $this->createMock('Psr\Http\Message\ResponseInterface'); |
| 565 | + $response = $this->createMock(Psr\\Http\Message\ResponseInterface:class); |
566 | 566 | $response->method('getBody')->willReturn(/* Psr\Http\Message\Interface instance containing expected response content. */); |
567 | 567 | $client->getContainer()->get('httplug.clients.my_awesome_backend.client')->addResponse($response); |
568 | 568 |
|
|
0 commit comments