Skip to content

Commit b72eab3

Browse files
committed
Add generic types to traversable implementations
1 parent 714059c commit b72eab3

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

HttplugClient.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ final class HttplugClient implements HttplugInterface, HttpAsyncClient, RequestF
6161
private $client;
6262
private $responseFactory;
6363
private $streamFactory;
64+
65+
/**
66+
* @var \SplObjectStorage<ResponseInterface, array{RequestInterface, Promise}>|null
67+
*/
6468
private $promisePool;
69+
6570
private $waitLoop;
6671

6772
public function __construct(HttpClientInterface $client = null, ResponseFactoryInterface $responseFactory = null, StreamFactoryInterface $streamFactory = null)

Internal/HttplugWaitLoop.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
namespace Symfony\Component\HttpClient\Internal;
1313

1414
use Http\Client\Exception\NetworkException;
15+
use Http\Promise\Promise;
16+
use Psr\Http\Message\RequestInterface as Psr7RequestInterface;
1517
use Psr\Http\Message\ResponseFactoryInterface;
1618
use Psr\Http\Message\ResponseInterface as Psr7ResponseInterface;
1719
use Psr\Http\Message\StreamFactoryInterface;
@@ -33,6 +35,9 @@ final class HttplugWaitLoop
3335
private $responseFactory;
3436
private $streamFactory;
3537

38+
/**
39+
* @param \SplObjectStorage<ResponseInterface, array{Psr7RequestInterface, Promise}>|null $promisePool
40+
*/
3641
public function __construct(HttpClientInterface $client, ?\SplObjectStorage $promisePool, ResponseFactoryInterface $responseFactory, StreamFactoryInterface $streamFactory)
3742
{
3843
$this->client = $client;

Response/AsyncResponse.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,9 @@ public static function stream(iterable $responses, float $timeout = null, string
311311
}
312312
}
313313

314+
/**
315+
* @param \SplObjectStorage<ResponseInterface, AsyncResponse>|null $asyncMap
316+
*/
314317
private static function passthru(HttpClientInterface $client, self $r, ChunkInterface $chunk, \SplObjectStorage $asyncMap = null): \Generator
315318
{
316319
$r->stream = null;
@@ -332,6 +335,9 @@ private static function passthru(HttpClientInterface $client, self $r, ChunkInte
332335
yield from self::passthruStream($response, $r, null, $asyncMap);
333336
}
334337

338+
/**
339+
* @param \SplObjectStorage<ResponseInterface, AsyncResponse>|null $asyncMap
340+
*/
335341
private static function passthruStream(ResponseInterface $response, self $r, ?ChunkInterface $chunk, ?\SplObjectStorage $asyncMap): \Generator
336342
{
337343
while (true) {

Response/TransportResponseTrait.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ private function doDestruct()
146146
/**
147147
* Implements an event loop based on a buffer activity queue.
148148
*
149+
* @param iterable<array-key, self> $responses
150+
*
149151
* @internal
150152
*/
151153
public static function stream(iterable $responses, float $timeout = null): \Generator

0 commit comments

Comments
 (0)