Skip to content

Commit c827da0

Browse files
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
1 parent 955f7bd commit c827da0

22 files changed

+28
-28
lines changed

DataCollector/MessageDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(MessageLoggerListener $logger)
3232
/**
3333
* {@inheritdoc}
3434
*/
35-
public function collect(Request $request, Response $response, \Throwable $exception = null)
35+
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
3636
{
3737
$this->data['events'] = $this->events;
3838
}

Event/MessageEvents.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function getTransports(): array
3535
/**
3636
* @return MessageEvent[]
3737
*/
38-
public function getEvents(string $name = null): array
38+
public function getEvents(?string $name = null): array
3939
{
4040
if (null === $name) {
4141
return $this->events;
@@ -54,7 +54,7 @@ public function getEvents(string $name = null): array
5454
/**
5555
* @return RawMessage[]
5656
*/
57-
public function getMessages(string $name = null): array
57+
public function getMessages(?string $name = null): array
5858
{
5959
$events = $this->getEvents($name);
6060
$messages = [];

EventListener/EnvelopeListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class EnvelopeListener implements EventSubscriberInterface
3030
* @param Address|string $sender
3131
* @param array<Address|string> $recipients
3232
*/
33-
public function __construct($sender = null, array $recipients = null)
33+
public function __construct($sender = null, ?array $recipients = null)
3434
{
3535
if (null !== $sender) {
3636
$this->sender = Address::create($sender);

EventListener/MessageListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class MessageListener implements EventSubscriberInterface
4343
private $headerRules = [];
4444
private $renderer;
4545

46-
public function __construct(Headers $headers = null, BodyRendererInterface $renderer = null, array $headerRules = self::DEFAULT_RULES)
46+
public function __construct(?Headers $headers = null, ?BodyRendererInterface $renderer = null, array $headerRules = self::DEFAULT_RULES)
4747
{
4848
$this->headers = $headers;
4949
$this->renderer = $renderer;

Exception/HttpTransportException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class HttpTransportException extends TransportException
2020
{
2121
private $response;
2222

23-
public function __construct(?string $message, ResponseInterface $response, int $code = 0, \Throwable $previous = null)
23+
public function __construct(?string $message, ResponseInterface $response, int $code = 0, ?\Throwable $previous = null)
2424
{
2525
if (null === $message) {
2626
trigger_deprecation('symfony/mailer', '5.3', 'Passing null as $message to "%s()" is deprecated, pass an empty string instead.', __METHOD__);

Exception/UnsupportedSchemeException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class UnsupportedSchemeException extends LogicException
5858
],
5959
];
6060

61-
public function __construct(Dsn $dsn, string $name = null, array $supported = [])
61+
public function __construct(Dsn $dsn, ?string $name = null, array $supported = [])
6262
{
6363
$provider = $dsn->getScheme();
6464
if (false !== $pos = strpos($provider, '+')) {

Mailer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ final class Mailer implements MailerInterface
3232
private $bus;
3333
private $dispatcher;
3434

35-
public function __construct(TransportInterface $transport, MessageBusInterface $bus = null, EventDispatcherInterface $dispatcher = null)
35+
public function __construct(TransportInterface $transport, ?MessageBusInterface $bus = null, ?EventDispatcherInterface $dispatcher = null)
3636
{
3737
$this->transport = $transport;
3838
$this->bus = $bus;
3939
$this->dispatcher = class_exists(Event::class) && $dispatcher instanceof SymfonyEventDispatcherInterface ? LegacyEventDispatcherProxy::decorate($dispatcher) : $dispatcher;
4040
}
4141

42-
public function send(RawMessage $message, Envelope $envelope = null): void
42+
public function send(RawMessage $message, ?Envelope $envelope = null): void
4343
{
4444
if (null === $this->bus) {
4545
$this->transport->send($message, $envelope);

MailerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ interface MailerInterface
2626
/**
2727
* @throws TransportExceptionInterface
2828
*/
29-
public function send(RawMessage $message, Envelope $envelope = null): void;
29+
public function send(RawMessage $message, ?Envelope $envelope = null): void;
3030
}

Messenger/SendEmailMessage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class SendEmailMessage
2222
private $message;
2323
private $envelope;
2424

25-
public function __construct(RawMessage $message, Envelope $envelope = null)
25+
public function __construct(RawMessage $message, ?Envelope $envelope = null)
2626
{
2727
$this->message = $message;
2828
$this->envelope = $envelope;

Test/Constraint/EmailCount.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class EmailCount extends Constraint
2020
private $transport;
2121
private $queued;
2222

23-
public function __construct(int $expectedValue, string $transport = null, bool $queued = false)
23+
public function __construct(int $expectedValue, ?string $transport = null, bool $queued = false)
2424
{
2525
$this->expectedValue = $expectedValue;
2626
$this->transport = $transport;

0 commit comments

Comments
 (0)