} } /**
* @param \SplObjectStorage<ResponseInterface, AsyncResponse>|null $asyncMap
*/
private static function passthru(HttpClientInterface
$client, self
$r, ChunkInterface
$chunk, \SplObjectStorage
$asyncMap = null
): \Generator
{ $r->stream = null;
$response =
$r->response;
$context =
new AsyncContext($r->passthru,
$client,
$r->response,
$r->info,
$r->content,
$r->offset
);
if (null ===
$stream =
($r->passthru
)($chunk,
$context)) { if ($r->response ===
$response && (null !==
$chunk->
getError() ||
$chunk->
isLast())) { throw new \
LogicException('A chunk passthru cannot swallow the last chunk.'
);
} return;
} if (!
$stream instanceof \Iterator
) { throw new \
LogicException(sprintf('A chunk passthru must return an "Iterator", "%s" returned.',
get_debug_type($stream)));
}