Skip to content

Commit 295ddf3

Browse files
Merge branch '7.0' into 7.1
* 7.0: List CS fix in .git-blame-ignore-revs Fix implicitly-required parameters minor #53524 [Messenger] [AmazonSqs] Allow `async-aws/sqs` version 2 (smoench) Fix bad merge List CS fix in .git-blame-ignore-revs Fix implicitly-required parameters List CS fix in .git-blame-ignore-revs Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value [Messenger][AmazonSqs] Allow async-aws/sqs version 2
2 parents b9c30aa + 85019d3 commit 295ddf3

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

Tests/Transport/AmqpTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testReceivesMessages()
5252
$this->assertSame($decodedMessage, $envelopes[0]->getMessage());
5353
}
5454

55-
private function getTransport(SerializerInterface $serializer = null, Connection $connection = null): AmqpTransport
55+
private function getTransport(?SerializerInterface $serializer = null, ?Connection $connection = null): AmqpTransport
5656
{
5757
$serializer ??= $this->createMock(SerializerInterface::class);
5858
$connection ??= $this->createMock(Connection::class);

Transport/AmqpReceiver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class AmqpReceiver implements QueueReceiverInterface, MessageCountAwareInterface
3030
private SerializerInterface $serializer;
3131
private Connection $connection;
3232

33-
public function __construct(Connection $connection, SerializerInterface $serializer = null)
33+
public function __construct(Connection $connection, ?SerializerInterface $serializer = null)
3434
{
3535
$this->connection = $connection;
3636
$this->serializer = $serializer ?? new PhpSerializer();

Transport/AmqpSender.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class AmqpSender implements SenderInterface
2929
private SerializerInterface $serializer;
3030
private Connection $connection;
3131

32-
public function __construct(Connection $connection, SerializerInterface $serializer = null)
32+
public function __construct(Connection $connection, ?SerializerInterface $serializer = null)
3333
{
3434
$this->connection = $connection;
3535
$this->serializer = $serializer ?? new PhpSerializer();

Transport/AmqpStamp.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class AmqpStamp implements NonSendableStampInterface
2424
private array $attributes;
2525
private bool $isRetryAttempt = false;
2626

27-
public function __construct(string $routingKey = null, int $flags = \AMQP_NOPARAM, array $attributes = [])
27+
public function __construct(?string $routingKey = null, int $flags = \AMQP_NOPARAM, array $attributes = [])
2828
{
2929
$this->routingKey = $routingKey;
3030
$this->flags = $flags;
@@ -46,7 +46,7 @@ public function getAttributes(): array
4646
return $this->attributes;
4747
}
4848

49-
public static function createFromAmqpEnvelope(\AMQPEnvelope $amqpEnvelope, self $previousStamp = null, string $retryRoutingKey = null): self
49+
public static function createFromAmqpEnvelope(\AMQPEnvelope $amqpEnvelope, ?self $previousStamp = null, ?string $retryRoutingKey = null): self
5050
{
5151
$attr = $previousStamp->attributes ?? [];
5252

@@ -79,7 +79,7 @@ public function isRetryAttempt(): bool
7979
return $this->isRetryAttempt;
8080
}
8181

82-
public static function createWithAttributes(array $attributes, self $previousStamp = null): self
82+
public static function createWithAttributes(array $attributes, ?self $previousStamp = null): self
8383
{
8484
return new self(
8585
$previousStamp->routingKey ?? null,

Transport/AmqpTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class AmqpTransport implements QueueReceiverInterface, TransportInterface, Setup
2929
private AmqpReceiver $receiver;
3030
private AmqpSender $sender;
3131

32-
public function __construct(Connection $connection, SerializerInterface $serializer = null)
32+
public function __construct(Connection $connection, ?SerializerInterface $serializer = null)
3333
{
3434
$this->connection = $connection;
3535
$this->serializer = $serializer ?? new PhpSerializer();

Transport/Connection.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class Connection
9797
private \AMQPExchange $amqpDelayExchange;
9898
private int $lastActivityTime = 0;
9999

100-
public function __construct(#[\SensitiveParameter] array $connectionOptions, array $exchangeOptions, array $queuesOptions, AmqpFactory $amqpFactory = null)
100+
public function __construct(#[\SensitiveParameter] array $connectionOptions, array $exchangeOptions, array $queuesOptions, ?AmqpFactory $amqpFactory = null)
101101
{
102102
if (!\extension_loaded('amqp')) {
103103
throw new LogicException(sprintf('You cannot use the "%s" as the "amqp" extension is not installed.', __CLASS__));
@@ -161,7 +161,7 @@ public function __construct(#[\SensitiveParameter] array $connectionOptions, arr
161161
* * verify: Enable or disable peer verification. If peer verification is enabled then the common name in the
162162
* server certificate must match the server name. Peer verification is enabled by default.
163163
*/
164-
public static function fromDsn(#[\SensitiveParameter] string $dsn, array $options = [], AmqpFactory $amqpFactory = null): self
164+
public static function fromDsn(#[\SensitiveParameter] string $dsn, array $options = [], ?AmqpFactory $amqpFactory = null): self
165165
{
166166
if (false === $params = parse_url($dsn)) {
167167
// this is a valid URI that parse_url cannot handle when you want to pass all parameters as options
@@ -279,7 +279,7 @@ private static function hasCaCertConfigured(array $amqpOptions): bool
279279
/**
280280
* @throws \AMQPException
281281
*/
282-
public function publish(string $body, array $headers = [], int $delayInMs = 0, AmqpStamp $amqpStamp = null): void
282+
public function publish(string $body, array $headers = [], int $delayInMs = 0, ?AmqpStamp $amqpStamp = null): void
283283
{
284284
$this->clearWhenDisconnected();
285285

@@ -313,7 +313,7 @@ public function countMessagesInQueues(): int
313313
/**
314314
* @throws \AMQPException
315315
*/
316-
private function publishWithDelay(string $body, array $headers, int $delay, AmqpStamp $amqpStamp = null): void
316+
private function publishWithDelay(string $body, array $headers, int $delay, ?AmqpStamp $amqpStamp = null): void
317317
{
318318
$routingKey = $this->getRoutingKeyForMessage($amqpStamp);
319319
$isRetryAttempt = $amqpStamp ? $amqpStamp->isRetryAttempt() : false;
@@ -329,7 +329,7 @@ private function publishWithDelay(string $body, array $headers, int $delay, Amqp
329329
);
330330
}
331331

332-
private function publishOnExchange(\AMQPExchange $exchange, string $body, string $routingKey = null, array $headers = [], AmqpStamp $amqpStamp = null): void
332+
private function publishOnExchange(\AMQPExchange $exchange, string $body, ?string $routingKey = null, array $headers = [], ?AmqpStamp $amqpStamp = null): void
333333
{
334334
$attributes = $amqpStamp ? $amqpStamp->getAttributes() : [];
335335
$attributes['headers'] = array_merge($attributes['headers'] ?? [], $headers);

0 commit comments

Comments
 (0)