Skip to content

Commit 4e6e6d9

Browse files
committed
[Notifier] Fix SentMessage implementation
1 parent e6ec468 commit 4e6e6d9

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CHANGELOG
44
5.2.0
55
-----
66

7-
* [BC BREAK] The `TransportInterface::send()` and `AbstractTransport::doSend()` methods changed to return a `SentMessage` instance instead of `void`.
7+
* [BC BREAK] The `TransportInterface::send()` and `AbstractTransport::doSend()` methods changed to return a `?SentMessage` instance instead of `void`.
88

99
5.1.0
1010
-----

Chatter.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,20 @@ public function supports(MessageInterface $message): bool
4848
return $this->transport->supports($message);
4949
}
5050

51-
public function send(MessageInterface $message): SentMessage
51+
public function send(MessageInterface $message): ?SentMessage
5252
{
5353
if (null === $this->bus) {
54-
return $this->transport->send($message);
54+
$this->transport->send($message);
55+
56+
return null;
5557
}
5658

5759
if (null !== $this->dispatcher) {
5860
$this->dispatcher->dispatch(new MessageEvent($message, true));
5961
}
6062

6163
$this->bus->dispatch($message);
64+
65+
return null;
6266
}
6367
}

Texter.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,20 @@ public function supports(MessageInterface $message): bool
4848
return $this->transport->supports($message);
4949
}
5050

51-
public function send(MessageInterface $message): SentMessage
51+
public function send(MessageInterface $message): ?SentMessage
5252
{
5353
if (null === $this->bus) {
54-
return $this->transport->send($message);
54+
$this->transport->send($message);
55+
56+
return null;
5557
}
5658

5759
if (null !== $this->dispatcher) {
5860
$this->dispatcher->dispatch(new MessageEvent($message, true));
5961
}
6062

6163
$this->bus->dispatch($message);
64+
65+
return null;
6266
}
6367
}

Transport/TransportInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ interface TransportInterface
2525
/**
2626
* @throws TransportExceptionInterface
2727
*/
28-
public function send(MessageInterface $message): SentMessage;
28+
public function send(MessageInterface $message): ?SentMessage;
2929

3030
public function supports(MessageInterface $message): bool;
3131

0 commit comments

Comments
 (0)