8000 Merge branch '5.4' into 6.0 · Nommyde/symfony@df7084b · GitHub
[go: up one dir, main page]

Skip to content

Commit df7084b

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: Typos In Comments remove duplicated catch block s/<\br>/<br> [HttpClient] Fix retrying requests when the content is used by the strategy
2 parents 2136490 + ff2a9f4 commit df7084b

File tree

14 files changed

+23
-22
lines changed

14 files changed

+23
-22
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function marshall(array $values, ?array &$failed): array
5151
$serialized[$id][9] = "\x5F";
5252
}
5353
} else {
54-
// other arbitratry values are serialized using the decorated marshaller below
54+
// other arbitrary values are serialized using the decorated marshaller below
5555
$notSerialized[$id] = $value;
5656
}
5757
}

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
@@ -590,7 +590,7 @@ public function testDegradationWhenCacheLocked()
590590

591591
$this->cacheConfig['stale_while_revalidate'] = 10;
592592

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

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

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

250250
/**
251-
* Checks wether current platform supports table creation within transaction.
251+
* Checks whether current platform supports table creation within transaction.
252252
*/
253253
private function platformSupportsTableCreationInTransaction(): bool
254254
{

src/Symfony/Component/Mailer/Transport/SendmailTransport.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
/**
2424
* SendmailTransport for sending mail through a Sendmail/Postfix (etc..) binary.
2525
*
26-
* Transport can be instanciated through SendmailTransportFactory or NativeTransportFactory:
26+
* Transport can be instantiated through SendmailTransportFactory or NativeTransportFactory:
2727
*
28-
* - SendmailTransportFactory to use most common sendmail path and recommanded options
28+
* - SendmailTransportFactory to use most common sendmail path and recommended options
2929
* - NativeTransportFactory when configuration is set via php.ini
3030
*
3131
* @author Fabien Potencier <fabien@symfony.com>

src/Symfony/Component/Mailer/Transport/Smtp/Stream/SocketStream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function initialize(): void
145145
if ($this->streamContextOptions) {
146146
$options = array_merge($options, $this->streamContextOptions);
147147
}
148-
// do it unconditionnally as it will be used by STARTTLS as well if supported
148+
// do it unconditionally as it will be used by STARTTLS as well if supported
149149
$options['ssl']['crypto_method'] = $options['ssl']['crypto_method'] ?? \STREAM_CRYPTO_METHOD_TLS_CLIENT | \STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT | \STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
150150
$streamContext = stream_context_create($options);
151151

src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/ConnectionTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public function testClaimAbandonedMessageWithRaceCondition()
232232
$redis->expects($this->exactly(3))->method('xreadgroup')
233233
->withConsecutive(
234234
['symfony', 'consumer', ['queue' => '0'], 1, null], // first call for pending messages
235-
['symfony', 'consumer', ['queue' => '0'], 1, null], // sencond call because of claimed message (redisid-123)
235+
['symfony', 'consumer', ['queue' => '0'], 1, null], // second call because of claimed message (redisid-123)
236236
['symfony', 'consumer', ['queue' => '>'], 1, null] // third call because of no result (other consumer claimed message redisid-123)
237237
)
238238
->willReturnOnConsecutiveCalls([], [], []);
@@ -258,11 +258,11 @@ public function testClaimAbandonedMessage()
258258
$redis->expects($this->exactly(2))->method('xreadgroup')
259259
->withConsecutive(
260260
['symfony', 'consumer', ['queue' => '0'], 1, null], // first call for pending messages
261-
['symfony', 'consumer', ['queue' => '0'], 1, null] // sencond call because of claimed message (redisid-123)
261+
['symfony', 'consumer', ['queue' => '0'], 1, null] // second call because of claimed message (redisid-123)
262262
)
263263
->willReturnOnConsecutiveCalls(
264264
[], // first call returns no result
265-
['queue' => [['message' => '{"body":"1","headers":[]}']]] // second call returns clamed message (redisid-123)
265+
['queue' => [['message' => '{"body":"1","headers":[]}']]] // second call returns claimed message (redisid-123)
266266
);
267267

268268
$redis->expects($this->once())->method('xpending')->willReturn([[

src/Symfony/Component/PropertyInfo/Tests/Fixtures/DockBlockFallback.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Component\PropertyInfo\Tests\Fixtures;
1313

1414
/**
15-
* PhpDocExtractor should fallback from property -> accessor -> mutator when looking up dockblocks.
15+
* PhpDocExtractor should fallback from property -> accessor -> mutator when looking up docblocks.
1616
*
1717
* @author Martin Rademacher <mano@radebatz.net>
1818
*/

src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ private function validateEachObjectIn(iterable $collection, string $propertyPath
378378
* Validates a class node.
379379
*
380380
* A class node is a combination of an object with a {@link ClassMetadataInterface}
381-
* instance. Each class node (conceptionally) has zero or more succeeding
381+
* instance. Each class node (conceptually) has zero or more succeeding
382382
* property nodes:
383383
*
384384
* (Article:class node)

src/Symfony/Contracts/Translation/Test/TranslatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public function getChooseTests()
271271
['This is a text with a\nnew-line in it. Selector = 0.', '{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.', 0],
272272
// with double-quotes and id split accros lines
273273
["This is a text with a\nnew-line in it. Selector = 1.", "{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.", 1],
274-
// esacape pipe
274+
// escape pipe
275275
['This is a text with | in it. Selector = 0.', '{0}This is a text with || in it. Selector = 0.|{1}This is a text with || in it. Selector = 1.', 0],
276276
// Empty plural set (2 plural forms) from a .PO file
277277
['', '|', 1],

0 commit comments

Comments
 (0)
0