Skip to content

Commit

Permalink
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_…
Browse files Browse the repository at this point in the history
…null_value
  • Loading branch information
nicolas-grekas committed Jan 23, 2024
1 parent 67d65de commit 6b74de5
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 @@ -167,7 +167,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 = $serializer ?? $this->createMock(SerializerInterface::class);
$connection = $connection ?? $this->createMock(Connection::class);
Expand All @@ -178,7 +178,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 $messageGroupId;
private $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;
private $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 @@ -33,7 +33,7 @@ class AmazonSqsTransport implements TransportInterface, SetupableTransportInterf
private $receiver;
private $sender;

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 @@ -23,7 +23,7 @@ class AmazonSqsTransportFactory implements TransportFactoryInterface
{
private $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 @@ -60,7 +60,7 @@ class Connection
/** @var string|null */
private $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 @@ -101,7 +101,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(string $dsn, array $options = [], HttpClientInterface $client = null, LoggerInterface $logger = null): self
public static function fromDsn(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 @@ -313,7 +313,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 6b74de5

Please sign in to comment.