8000 Merge branch '6.1' into 6.2 · Nommyde/symfony@541e651 · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit 541e651

Browse files
committed
Merge branch '6.1' into 6.2
* 6.1: Typos In Comments typo s/retrieveing/retrieving Typos on 6.0 branch remove duplicated catch block s/<\br>/<br> [HttpClient] Fix retrying requests when the content is used by the strategy
2 parents 824a4de + b8a2366 commit 541e651

File tree

16 files changed

+25
-24
lines changed

16 files changed

+25
-24
lines changed

src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function loginUser(object $user, string $firewallContext = 'main'): stati
116116
}
117117

118118
$token = new TestBrowserToken($user->getRoles(), $user, $firewallContext);
119-
// required for compatibilty with Symfony 5.4
119+
// required for compatibility with Symfony 5.4
120120
if (method_exists($token, 'isAuthenticated')) {
121121
$token->setAuthenticated(true, false);
122122
}

src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* Implements simple and robust tag-based invalidation suitable for use with volatile caches.
2626
*
2727
* This adapter works by storing a version for each tags. When saving an item, it is stored together with its tags and
28-
* their corresponding versions. When retrieveing an item, those tag versions are compared to the current version of
28+
* their corresponding versions. When retrieving an item, those tag versions are compared to the current version of
2929
* each tags. Invalidation is achieved by deleting tags, thereby ensuring that their versions change even when the
3030
* storage is out of space. When versions of non-existing tags are requested for item commits, this adapter assigns a
3131
* new random version to them.

src/Symfony/Component/Cache/Marshaller/TagAwareMarshaller.php

Copy file name to clipboard
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function marshall(array $values, ?array &$failed): array
4848
$serialized[$id][9] = "\x5F";
4949
}
5050
} else {
51-
// other arbitratry values are serialized using the decorated marshaller below
51+
// other arbitrary values are serialized using the decorated marshaller below
5252
$notSerialized[$id] = $value;
5353
}
5454
}

src/Symfony/Component/DomCrawler/FormFieldRegistry.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function add(FormField $field)
4646
}
4747

4848
/**
49-
* Removes a field based on the fully qualifed name and its children from the registry.
49+
* Removes a field based on the fully qualified name and its children from the registry.
5050
*/
5151
public function remove(string $name)
5252
{
@@ -63,7 +63,7 @@ public function remove(string $name)
6363
}
6464

6565
/**
66-
* Returns the value of the field based on the fully qualifed name and its children.
66+
* Returns the value of the field based on the fully qualified name and its children.
6767
*
6868
* @return FormField|FormField[]|FormField[][]
6969
*

src/Symfony/Component/DomCrawler/Tests/AbstractCrawlerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,8 +1062,6 @@ public function testChildren()
10621062
$this->assertTrue(true, '->children() does not trigger a notice if the node has no children');
10631063
} catch (\PHPUnit\Framework\Error\Notice $e) {
10641064
$this->fail('->children() does not trigger a notice if the node has no children');
1065-
} catch (\PHPUnit\Framework\Error\Notice $e) {
1066-
$this->fail('->children() does not trigger a notice if the node has no children');
10671065
}
10681066
}
10691067

src/Symfony/Component/ErrorHandler/Resources/views/traces.html.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
$class = substr($exception['class'], $separator);
1313
?>
1414
<?php if ('' === $class) { ?>
15-
</br>
15+
<br>
1616
<?php } else { ?>
1717
<h3 class="trace-class">
1818
<?php if ('' !== $namespace) { ?>

src/Symfony/Component/HttpClient/RetryableHttpClient.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function request(string $method, string $url, array $options = []): Respo
6060
return new AsyncResponse($this->client, $method, $url, $options, function (ChunkInterface $chunk, AsyncContext $context) use ($method, $url, $options, &$retryCount, &$content, &$firstChunk) {
6161
$exception = null;
6262
try {
63-
if ($chunk->isTimeout() || null !== $chunk->getInformationalStatus() || $context->getInfo('canceled')) {
63+
if ($context->getInfo('canceled') || $chunk->isTimeout() || null !== $chunk->getInformationalStatus()) {
6464
yield $chunk;
6565

6666
return;
@@ -118,6 +118,8 @@ public function request(string $method, string $url, array $options = []): Respo
118118

119119
$delay = $this->getDelayFromHeader($context->getHeaders()) ?? $this->strategy->getDelay($context, !$exception && $chunk->isLast() ? $content : null, $exception);
120120
++$retryCount;
121+
$content = '';
122+
$firstChunk = null;
121123

122124
$this->logger->info('Try #{count} after {delay}ms'.($exception ? ': '.$exception->getMessage() : ', status code: '.$context->getStatusCode()), [
123125
'count' => $retryCount,

src/Symfony/Component/HttpClient/Tests/RetryableHttpClientTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,22 @@ public function testRetryWithBody()
6262
{
6363
$client = new RetryableHttpClient(
6464
new MockHttpClient([
65-
new MockResponse('', ['http_code' => 500]),
66-
new MockResponse('', ['http_code' => 200]),
65+
new MockResponse('abc', ['http_code' => 500]),
66+
new MockResponse('def', ['http_code' => 200]),
6767
]),
6868
new class(GenericRetryStrategy::DEFAULT_RETRY_STATUS_CODES, 0) extends GenericRetryStrategy {
6969
public function shouldRetry(AsyncContext $context, ?string $responseContent, ?TransportExceptionInterface $exception): ?bool
7070
{
71-
return null === $responseContent ? null : 200 !== $context->getStatusCode();
71+
return 500 === $context->getStatusCode() && null === $responseContent ? null : 200 !== $context->getStatusCode();
7272
}
7373
},
74-
1
74+
2
7575
);
7676

7777
$response = $client->request('GET', 'http://example.com/foo-bar');
7878

7979
self::assertSame(200, $response->getStatusCode());
80+
self::assertSame('def', $response->getContent());
8081
}
8182

8283
public function testRetryWithBodyKeepContent()

src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ public function testDegradationWhenCacheLocked()
692692

693693
$this->cacheConfig['stale_while_revalidate'] = 10;
694694

695-
// The prescence of Last-Modified makes this cacheable (because Response::isValidateable() then).
695+
// The presence of Last-Modified makes this cacheable (because Response::isValidateable() then).
696696
$this->setNextResponse(200, ['Cache-Control' => 'public, s-maxage=5', 'Last-Modified' => 'some while ago'], 'Old response');
697697
$this->request('GET', '/'); // warm the cache
698698

src/Symfony/Component/Lock/Store/DoctrineDbalStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ private function getCurrentTimestampStatement(): string
226226
}
227227

228228
/**
229-
* Checks wether current platform supports table creation within transaction.
229+
* Checks whether current platform supports table creation within transaction.
230230
*/
231231
private function platformSupportsTableCreationInTransaction(): bool
232232
{

0 commit comments

Comments
 (0)
0