mirror of
https://github.com/guzzle/guzzle.git
synced 2025-02-23 01:23:39 +01:00
Merge pull request #2159 from nicolasmure/fix/pool-doc
[Doc] typehint Pool's 'fulfilled' and 'rejected' callbacks
This commit is contained in:
commit
c84df5fc88
@ -200,9 +200,11 @@ amount of requests you wish to send.
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
use GuzzleHttp\Pool;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
use GuzzleHttp\Pool;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use GuzzleHttp\Psr7\Response;
|
||||
|
||||
$client = new Client();
|
||||
|
||||
@ -215,10 +217,10 @@ amount of requests you wish to send.
|
||||
|
||||
$pool = new Pool($client, $requests(100), [
|
||||
'concurrency' => 5,
|
||||
'fulfilled' => function ($response, $index) {
|
||||
'fulfilled' => function (Response $response, $index) {
|
||||
// this is delivered each successful response
|
||||
},
|
||||
'rejected' => function ($reason, $index) {
|
||||
'rejected' => function (RequestException $reason, $index) {
|
||||
// this is delivered each failed request
|
||||
},
|
||||
]);
|
||||
@ -480,7 +482,7 @@ which returns a ``GuzzleHttp\Cookie\SetCookie`` instance.
|
||||
$cookie->getExpires(); // expiration date as a Unix timestamp
|
||||
|
||||
The cookies can be also fetched into an array thanks to the `toArray()` method.
|
||||
The ``GuzzleHttp\Cookie\CookieJarInterface`` interface extends
|
||||
The ``GuzzleHttp\Cookie\CookieJarInterface`` interface extends
|
||||
``Traversable`` so it can be iterated in a foreach loop.
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user