Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 76b9219

Browse files
committed
minor #46119 [HttpClient]  Add missing return type (GromNaN)
This PR was merged into the 6.1 branch. Discussion ---------- [HttpClient]  Add missing return type | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | n/a | License | MIT | Doc PR | n/a Return type on private methods; useful when reading the code. Commits ------- 2daae46 Add missing return type to HttpClient
2 parents e740a11 + 2daae46 commit 76b9219

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/Symfony/Component/HttpClient/Response/AmpResponse.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ private static function select(ClientState $multi, float $timeout): int
226226
return null === self::$delay ? 1 : 0;
227227
}
228228

229-
private static function generateResponse(Request $request, AmpClientState $multi, string $id, array &$info, array &$headers, CancellationTokenSource $canceller, array &$options, \Closure $onProgress, &$handle, ?LoggerInterface $logger, Promise &$pause)
229+
private static function generateResponse(Request $request, AmpClientState $multi, string $id, array &$info, array &$headers, CancellationTokenSource $canceller, array &$options, \Closure $onProgress, &$handle, ?LoggerInterface $logger, Promise &$pause): \Generator
230230
{
231231
$request->setInformationalResponseHandler(static function (Response $response) use ($multi, $id, &$info, &$headers) {
232232
self::addResponseHeaders($response, $info, $headers);
@@ -285,7 +285,7 @@ private static function generateResponse(Request $request, AmpClientState $multi
285285
self::stopLoop();
286286
}
287287

288-
private static function followRedirects(Request $originRequest, AmpClientState $multi, array &$info, array &$headers, CancellationTokenSource $canceller, array $options, \Closure $onProgress, &$handle, ?LoggerInterface $logger, Promise &$pause)
288+
private static function followRedirects(Request $originRequest, AmpClientState $multi, array &$info, array &$headers, CancellationTokenSource $canceller, array $options, \Closure $onProgress, &$handle, ?LoggerInterface $logger, Promise &$pause): \Generator
289289
{
290290
yield $pause;
291291

@@ -399,7 +399,7 @@ private static function addResponseHeaders(Response $response, array &$info, arr
399399
/**
400400
* Accepts pushed responses only if their headers related to authentication match the request.
401401
*/
402-
private static function getPushedResponse(Request $request, AmpClientState $multi, array &$info, array &$headers, array $options, ?LoggerInterface $logger)
402+
private static function getPushedResponse(Request $request, AmpClientState $multi, array &$info, array &$headers, array $options, ?LoggerInterface $logger): \Generator
403403
{
404404
if ('' !== $options['body']) {
405405
return null;

src/Symfony/Component/HttpClient/Response/MockResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ protected static function select(ClientState $multi, float $timeout): int
229229
/**
230230
* Simulates sending the request.
231231
*/
232-
private static function writeRequest(self $response, array $options, ResponseInterface $mock)
232+
private static function writeRequest(self $response, array $options, ResponseInterface $mock): void
233233
{
234234
$onProgress = $options['on_progress'] ?? static function () {};
235235
$response->info += $mock->getInfo() ?: [];
@@ -272,7 +272,7 @@ private static function writeRequest(self $response, array $options, ResponseInt
272272
/**
273273
* Simulates reading the response.
274274
*/
275-
private static function readResponse(self $response, array $options, ResponseInterface $mock, int &$offset)
275+
private static function readResponse(self $response, array $options, ResponseInterface $mock, int &$offset): void
276276
{
277277
$onProgress = $options['on_progress'] ?? static function () {};
278278

src/Symfony/Component/HttpClient/Response/StreamWrapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function stream_open(string $path, string $mode, int $options): bool
117117
return false;
118118
}
119119

120-
public function stream_read(int $count)
120+
public function stream_read(int $count): string|false
121121
{
122122
if (\is_resource($this->content)) {
123123
// Empty the internal activity list

src/Symfony/Component/HttpClient/Response/TraceableResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public static function stream(HttpClientInterface $client, iterable $responses,
202202
}
203203
}
204204

205-
private function checkStatusCode(int $code)
205+
private function checkStatusCode(int $code): void
206206
{
207207
if (500 <= $code) {
208208
throw new ServerException($this);

src/Symfony/Component/HttpClient/Response/TransportResponseTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ private static function addResponseHeaders(array $responseHeaders, array &$info,
131131
/**
132132
* Ensures the request is always sent and that the response code was checked.
133133
*/
134-
private function doDestruct()
134+
private function doDestruct(): void
135135
{
136136
$this->shouldBuffer = true;
137137

0 commit comments

Comments
 (0)