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

Skip to content

Commit bdafae5

Browse files
jderussedeguif
andcommitted
Update src/Symfony/Component/Messenger/Transport/SqsExt/Connection.php
Co-Authored-By: François-Xavier de Guillebon <[email protected]>
1 parent 141971b commit bdafae5

File tree

3 files changed

+5
-26
lines changed

3 files changed

+5
-26
lines changed

src/Symfony/Component/Messenger/Tests/Transport/SqsExt/SqsExtIntegrationTest.php

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class SqsExtIntegrationTest extends TestCase
1919
{
2020
private $connection;
2121

22-
protected function setUp()
22+
protected function setUp(): void
2323
{
2424
if (!getenv('MESSENGER_SQS_DSN')) {
2525
$this->markTestSkipped('The "MESSENGER_SQS_DSN" environment variable is required.');
@@ -42,27 +42,6 @@ public function testConnectionSendAndGet()
4242
$this->assertEquals(['type' => DummyMessage::class], $encoded['headers']);
4343
}
4444

45-
public function testGetTheFirstAvailableMessage()
46-
{
47-
$this->connection->send('{"message": "Hi1"}', ['type' => DummyMessage::class]);
48-
$this->connection->send('{"message": "Hi2"}', ['type' => DummyMessage::class]);
49-
$wait = 0;
50-
while ((null === $encoded1 = $this->connection->get()) && $wait++ < 50) {
51-
usleep(5000);
52-
}
53-
$this->assertEquals(['type' => DummyMessage::class], $encoded1['headers']);
54-
55-
$wait = 0;
56-
while ((null === $encoded2 = $this->connection->get()) && $wait++ < 50) {
57-
usleep(5000);
58-
}
59-
$this->assertEquals(['type' => DummyMessage::class], $encoded2['headers']);
60-
61-
$messages = [$encoded2['body'], $encoded2['body']];
62-
sort($messages);
63-
$this->assertEquals(['{"message": "Hi1"}', '{"message": "Hi2"}'], $messages);
64-
}
65-
6645
private function clearSqs()
6746
{
6847
$this->connection->requeuePrefetchedMessages();

src/Symfony/Component/Messenger/Transport/Receiver/DisconnectedReceiverInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
interface DisconnectedReceiverInterface
2424
{
2525
/**
26-
* Send back prefetch messages into the queue.
26+
* Sends back prefetch messages into the queue.
2727
*
2828
* @throws TransportException If there is an issue communicating with the transport
2929
*/
3030
public function requeuePrefetchMessages(): void;
3131

3232
/**
33-
* Send explicit confirmation that the message IS NOT handled and must be re-distributed.
33+
* Sends explicit confirmation that the message IS NOT handled and must be re-distributed.
3434
*
3535
* @throws TransportException If there is an issue communicating with the transport
3636
*/

src/Symfony/Component/Messenger/Transport/SqsExt/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function __construct(array $configuration, HttpClientInterface $client =
7474
* * buffer_size: number of messages to prefetch (Default: 9)
7575
* * wait_time: long polling duration in seconds (Default: 20)
7676
* * visibility_timeout: amount of seconds the message won't be visible
77-
* * auto_setup: Whether the table should be created automatically during send / get (Default: true)
77+
* * auto_setup: Whether the queue should be created automatically during send / get (Default: true)
7878
*/
7979
public static function fromDsn(string $dsn, array $options = [], HttpClientInterface $client = null): self
8080
{
@@ -240,7 +240,7 @@ public function requeue(string $id, int $delay = 0): void
240240

241241
public function requeuePrefetchedMessages(): void
242242
{
243-
if ($this->currentResponse !== null) {
243+
if (null !== $this->currentResponse) {
244244
$this->currentResponse->cancel();
245245
}
246246

0 commit comments

Comments
 (0)