Skip to content

Commit

Permalink
Merge branch '6.3' into 6.4
Browse files Browse the repository at this point in the history
* 6.3:
  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
  • Loading branch information
nicolas-grekas committed Jan 23, 2024
2 parents 164c7a1 + 9598344 commit 7f47bb0
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Tests/Transport/AmazonSqsTransportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function testItConvertsHttpExceptionDuringResetIntoTransportException()
$this->transport->reset();
}

private function getTransport(SerializerInterface $serializer = null, Connection $connection = null)
private function getTransport(?SerializerInterface $serializer = null, ?Connection $connection = null)
{
$serializer ??= $this->createMock(SerializerInterface::class);
$connection ??= $this->createMock(Connection::class);
Expand All @@ -163,7 +163,7 @@ private function getTransport(SerializerInterface $serializer = null, Connection
private function createHttpException(): HttpException
{
$response = $this->createMock(ResponseInterface::class);
$response->method('getInfo')->willReturnCallback(static function (string $type = null) {
$response->method('getInfo')->willReturnCallback(static function (?string $type = null) {
$info = [
'http_code' => 500,
'url' => 'https://symfony.com',
Expand Down
2 changes: 1 addition & 1 deletion Transport/AmazonSqsFifoStamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class AmazonSqsFifoStamp implements NonSendableStampInterface
private ?string $messageGroupId;
private ?string $messageDeduplicationId;

public function __construct(string $messageGroupId = null, string $messageDeduplicationId = null)
public function __construct(?string $messageGroupId = null, ?string $messageDeduplicationId = null)
{
$this->messageGroupId = $messageGroupId;
$this->messageDeduplicationId = $messageDeduplicationId;
Expand Down
2 changes: 1 addition & 1 deletion Transport/AmazonSqsReceiver.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AmazonSqsReceiver implements ReceiverInterface, MessageCountAwareInterface
private Connection $connection;
private SerializerInterface $serializer;

public function __construct(Connection $connection, SerializerInterface $serializer = null)
public function __construct(Connection $connection, ?SerializerInterface $serializer = null)
{
$this->connection = $connection;
$this->serializer = $serializer ?? new PhpSerializer();
Expand Down
2 changes: 1 addition & 1 deletion Transport/AmazonSqsTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AmazonSqsTransport implements TransportInterface, SetupableTransportInterf
/**
* @param (MessageCountAwareInterface&ReceiverInterface)|null $receiver
*/
public function __construct(Connection $connection, SerializerInterface $serializer = null, ReceiverInterface $receiver = null, SenderInterface $sender = null)
public function __construct(Connection $connection, ?SerializerInterface $serializer = null, ?ReceiverInterface $receiver = null, ?SenderInterface $sender = null)
{
$this->connection = $connection;
$this->serializer = $serializer ?? new PhpSerializer();
Expand Down
2 changes: 1 addition & 1 deletion Transport/AmazonSqsTransportFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AmazonSqsTransportFactory implements TransportFactoryInterface
{
private ?LoggerInterface $logger;

public function __construct(LoggerInterface $logger = null)
public function __construct(?LoggerInterface $logger = null)
{
$this->logger = $logger;
}
Expand Down
6 changes: 3 additions & 3 deletions Transport/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Connection
private array $buffer = [];
private ?string $queueUrl;

public function __construct(array $configuration, SqsClient $client = null, string $queueUrl = null)
public function __construct(array $configuration, ?SqsClient $client = null, ?string $queueUrl = null)
{
$this->configuration = array_replace_recursive(self::DEFAULT_OPTIONS, $configuration);
$this->client = $client ?? new SqsClient([]);
Expand Down Expand Up @@ -103,7 +103,7 @@ public function __destruct()
* * auto_setup: Whether the queue should be created automatically during send / get (Default: true)
* * debug: Log all HTTP requests and responses as LoggerInterface::DEBUG (Default: false)
*/
public static function fromDsn(#[\SensitiveParameter] string $dsn, array $options = [], HttpClientInterface $client = null, LoggerInterface $logger = null): self
public static function fromDsn(#[\SensitiveParameter] string $dsn, array $options = [], ?HttpClientInterface $client = null, ?LoggerInterface $logger = null): self
{
if (false === $params = parse_url($dsn)) {
throw new InvalidArgumentException('The given Amazon SQS DSN is invalid.');
Expand Down Expand Up @@ -318,7 +318,7 @@ public function getMessageCount(): int
return (int) ($attributes[QueueAttributeName::APPROXIMATE_NUMBER_OF_MESSAGES] ?? 0);
}

public function send(string $body, array $headers, int $delay = 0, string $messageGroupId = null, string $messageDeduplicationId = null, string $xrayTraceId = null): void
public function send(string $body, array $headers, int $delay = 0, ?string $messageGroupId = null, ?string $messageDeduplicationId = null, ?string $xrayTraceId = null): void
{
if ($this->configuration['auto_setup']) {
$this->setup();
Expand Down

0 comments on commit 7f47bb0

Please sign in to comment.