Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit45e23a7

Browse files
committed
Make sure that a transport name is always set
1 parent0c90761 commit45e23a7

File tree

6 files changed

+12
-4
lines changed

6 files changed

+12
-4
lines changed

‎src/Symfony/Component/Notifier/Message/ChatMessage.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function getOptions(): ?MessageOptionsInterface
7777
/**
7878
* @return $this
7979
*/
80-
publicfunctiontransport(?string$transport):self
80+
publicfunctiontransport(?string$transport):MessageInterface
8181
{
8282
$this->transport =$transport;
8383

‎src/Symfony/Component/Notifier/Message/EmailMessage.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function getOptions(): ?MessageOptionsInterface
102102
/**
103103
* @return $this
104104
*/
105-
publicfunctiontransport(string$transport):self
105+
publicfunctiontransport(string$transport):MessageInterface
106106
{
107107
if (!$this->messageinstanceof Email) {
108108
thrownewLogicException('Cannot set a Transport on a RawMessage instance.');

‎src/Symfony/Component/Notifier/Message/MessageInterface.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ public function getSubject(): string;
2525
publicfunctiongetOptions(): ?MessageOptionsInterface;
2626

2727
publicfunctiongetTransport(): ?string;
28+
29+
publicfunctiontransport(string$transport):self;
2830
}

‎src/Symfony/Component/Notifier/Message/SmsMessage.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function getSubject(): string
8383
/**
8484
* @return $this
8585
*/
86-
publicfunctiontransport(string$transport):self
86+
publicfunctiontransport(string$transport):MessageInterface
8787
{
8888
$this->transport =$transport;
8989

‎src/Symfony/Component/Notifier/Transport/NullTransport.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ public function __construct(EventDispatcherInterface $dispatcher = null)
3434

3535
publicfunctionsend(MessageInterface$message):SentMessage
3636
{
37+
if (null ===$message->getTransport()) {
38+
$message->transport((string)$this);
39+
}
40+
3741
if (null !==$this->dispatcher) {
3842
$this->dispatcher->dispatch(newMessageEvent($message));
3943
}

‎src/Symfony/Component/Notifier/Transport/Transports.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ public function supports(MessageInterface $message): bool
5555
publicfunctionsend(MessageInterface$message):SentMessage
5656
{
5757
if (!$transport =$message->getTransport()) {
58-
foreach ($this->transportsas$transport) {
58+
foreach ($this->transportsas$transportName =>$transport) {
5959
if ($transport->supports($message)) {
60+
$message->transport($transportName);
61+
6062
return$transport->send($message);
6163
}
6264
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp