Skip to content

Commit c2ccb5b

Browse files
author
Olivier Dolbeau
committed
Make EmailMessage & SmsMessage transport nullable
1 parent 32020f1 commit c2ccb5b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Message/EmailMessage.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,14 @@ public function getOptions(): ?MessageOptionsInterface
9797
/**
9898
* @return $this
9999
*/
100-
public function transport(string $transport): self
100+
public function transport(?string $transport): self
101101
{
102102
if (!$this->message instanceof Email) {
103103
throw new LogicException('Cannot set a Transport on a RawMessage instance.');
104104
}
105+
if (null === $transport) {
106+
return $this;
107+
}
105108

106109
$this->message->getHeaders()->addTextHeader('X-Transport', $transport);
107110

Message/SmsMessage.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function getSubject(): string
8181
/**
8282
* @return $this
8383
*/
84-
public function transport(string $transport): self
84+
public function transport(?string $transport): self
8585
{
8686
$this->transport = $transport;
8787

0 commit comments

Comments
 (0)