Skip to content

Commit 96c5ff3

Browse files
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
1 parent 98ea3a5 commit 96c5ff3

34 files changed

+44
-44
lines changed

Channel/AbstractChannel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ abstract class AbstractChannel implements ChannelInterface
2323
protected $transport;
2424
protected $bus;
2525

26-
public function __construct(TransportInterface $transport = null, MessageBusInterface $bus = null)
26+
public function __construct(?TransportInterface $transport = null, ?MessageBusInterface $bus = null)
2727
{
2828
if (null === $transport && null === $bus) {
2929
throw new LogicException(sprintf('"%s" needs a Transport or a Bus but both cannot be "null".', static::class));

Channel/BrowserChannel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct(RequestStack $stack)
2727
$this->stack = $stack;
2828
}
2929

30-
public function notify(Notification $notification, RecipientInterface $recipient, string $transportName = null): void
30+
public function notify(Notification $notification, RecipientInterface $recipient, ?string $transportName = null): void
3131
{
3232
if (null === $request = $this->stack->getCurrentRequest()) {
3333
return;

Channel/ChannelInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
interface ChannelInterface
2121
{
22-
public function notify(Notification $notification, RecipientInterface $recipient, string $transportName = null): void;
22+
public function notify(Notification $notification, RecipientInterface $recipient, ?string $transportName = null): void;
2323

2424
public function supports(Notification $notification, RecipientInterface $recipient): bool;
2525
}

Channel/ChatChannel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222
class ChatChannel extends AbstractChannel
2323
{
24-
public function notify(Notification $notification, RecipientInterface $recipient, string $transportName = null): void
24+
public function notify(Notification $notification, RecipientInterface $recipient, ?string $transportName = null): void
2525
{
2626
$message = null;
2727
if ($notification instanceof ChatNotificationInterface) {

Channel/EmailChannel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class EmailChannel implements ChannelInterface
3333
private $from;
3434
private $envelope;
3535

36-
public function __construct(TransportInterface $transport = null, MessageBusInterface $bus = null, string $from = null, Envelope $envelope = null)
36+
public function __construct(?TransportInterface $transport = null, ?MessageBusInterface $bus = null, ?string $from = null, ?Envelope $envelope = null)
3737
{
3838
if (null === $transport && null === $bus) {
3939
throw new LogicException(sprintf('"%s" needs a Transport or a Bus but both cannot be "null".', static::class));
@@ -45,7 +45,7 @@ public function __construct(TransportInterface $transport = null, MessageBusInte
4545
$this->envelope = $envelope;
4646
}
4747

48-
public function notify(Notification $notification, RecipientInterface $recipient, string $transportName = null): void
48+
public function notify(Notification $notification, RecipientInterface $recipient, ?string $transportName = null): void
4949
{
5050
$message = null;
5151
if ($notification instanceof EmailNotificationInterface) {

Channel/PushChannel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222
class PushChannel extends AbstractChannel
2323
{
24-
public function notify(Notification $notification, RecipientInterface $recipient, string $transportName = null): void
24+
public function notify(Notification $notification, RecipientInterface $recipient, ?string $transportName = null): void
2525
{
2626
$message = null;
2727
if ($notification instanceof PushNotificationInterface) {

Channel/SmsChannel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
class SmsChannel extends AbstractChannel
2424
{
25-
public function notify(Notification $notification, RecipientInterface $recipient, string $transportName = null): void
25+
public function notify(Notification $notification, RecipientInterface $recipient, ?string $transportName = null): void
2626
{
2727
$message = null;
2828
if ($notification instanceof SmsNotificationInterface) {

Chatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class Chatter implements ChatterInterface
2929
private $bus;
3030
private $dispatcher;
3131

32-
public function __construct(TransportInterface $transport, MessageBusInterface $bus = null, EventDispatcherInterface $dispatcher = null)
32+
public function __construct(TransportInterface $transport, ?MessageBusInterface $bus = null, ?EventDispatcherInterface $dispatcher = null)
3333
{
3434
$this->transport = $transport;
3535
$this->bus = $bus;

DataCollector/NotificationDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(NotificationLoggerListener $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->logger->getEvents();
3838
}

Event/NotificationEvents.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 MessageInterface[]
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 = [];

0 commit comments

Comments
 (0)