Skip to content

Commit

Permalink
assign variables before if
Browse files Browse the repository at this point in the history
  • Loading branch information
jderusse committed Sep 16, 2020
1 parent 6523df7 commit 731b2d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Symfony/Component/HttpClient/RetryHttpClient.php
Expand Up @@ -75,7 +75,9 @@ public function request(string $method, string $url, array $options = []): Respo
// catch TransportExceptionInterface to send it to strategy.
}

if ($retryCount >= $this->maxRetries || !$this->decider->shouldRetry($method, $url, $options, $partialResponse = new MockResponse($context->getContent(), ['http_code' => $statusCode = $context->getStatusCode(), 'headers' => $headers = $context->getHeaders()]), $exception)) {
$statusCode = $context->getStatusCode();
$headers = $context->getHeaders();
if ($retryCount >= $this->maxRetries || !$this->decider->shouldRetry($method, $url, $options, $partialResponse = new MockResponse($context->getContent(), ['http_code' => $statusCode, 'headers' => $headers]), $exception)) {
$context->passthru();
yield $chunk;

Expand Down

0 comments on commit 731b2d3

Please sign in to comment.