Skip to content

Commit 793348d

Browse files
committed
Improve type hinting
1 parent 49dcaf7 commit 793348d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/Browser.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Fig\Http\Message\StatusCodeInterface;
99
use GuzzleHttp\Psr7\Utils;
1010
use Psr\Http\Message\ResponseInterface;
11+
use Psr\Http\Message\StreamInterface;
1112
use React\EventLoop;
1213
use React\Http\Io\HttpBodyStream;
1314
use React\Http\Message\ResponseException;
@@ -562,7 +563,12 @@ private function curlTick(): void
562563
}
563564
}
564565

565-
private function resolveResponse($mh, $curl): ResponseInterface
566+
/**
567+
* @param CurlMultiHandle $mh
568+
* @param CurlHandle $curl
569+
* @return ResponseInterface
570+
*/
571+
private function resolveResponse(CurlMultiHandle $mh, CurlHandle $curl): ResponseInterface
566572
{
567573
$responseBody = $this->inProgress[$mh]->file;
568574
if (is_resource($responseBody)) {
@@ -579,7 +585,13 @@ private function resolveResponse($mh, $curl): ResponseInterface
579585
return $this->constructResponseFromCurl($curl, $headers, $responseBody);
580586
}
581587

582-
private function constructResponseFromCurl(CurlHandle $curl, string $rawHeaders, $body) : ResponseInterface {
588+
/**
589+
* @param CurlHandle $curl
590+
* @param string $rawHeaders
591+
* @param ThroughStream|StreamInterface $body
592+
* @return ResponseInterface
593+
*/
594+
private function constructResponseFromCurl(CurlHandle $curl, string $rawHeaders, ThroughStream|StreamInterface $body) : ResponseInterface {
583595
$redirectCount = curl_getinfo($curl, CURLINFO_REDIRECT_COUNT);
584596
$headers = [];
585597
$lines = preg_split('/(\\r?\\n)/', trim($rawHeaders), -1);

0 commit comments

Comments
 (0)