Skip to content

Commit a0ff181

Browse files
Merge branch '5.2' into 5.x
* 5.2: µCS fix CS fix CS fix [travis] use PHP 8.0 to patch return types and run deps=low Add me as a Notifier code owner Update sl_SI translations Don't trigger deprecation for deprecated aliases pointing to deprecated definitions [HttpFoundation] use atomic writes in MockFileSessionStorage fix typo Make EmailMessage & SmsMessage transport nullable remove unused argument [SecurityBundle] Drop dead check [DI] fix param annotation [SecurityBundle] Remove invalid service definition [Config] Add \Symfony\Component\Config\Loader::load() return type Simplify PHP CS Fixer config Rename normalize param
2 parents 33485d9 + bdb8702 commit a0ff181

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Message/EmailMessage.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,14 @@ public function getOptions(): ?MessageOptionsInterface
100100
/**
101101
* @return $this
102102
*/
103-
public function transport(string $transport): self
103+
public function transport(?string $transport): self
104104
{
105105
if (!$this->message instanceof Email) {
106106
throw new LogicException('Cannot set a Transport on a RawMessage instance.');
107107
}
108+
if (null === $transport) {
109+
return $this;
110+
}
108111

109112
$this->message->getHeaders()->addTextHeader('X-Transport', $transport);
110113

Message/SmsMessage.php

Lines changed: 1 addition & 1 deletion
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)