8000 fix getName() when transport is null · symfony/symfony@ee4192e · GitHub
[go: up one dir, main page]

Skip to content

Commit ee4192e

Browse files
committed
fix getName() when transport is null
1 parent 233562f commit ee4192e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Symfony/Component/Mailer/Transport/AbstractTransport.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ public function __construct(EventDispatcherInterface $dispatcher = null, LoggerI
3939
$this->logger = $logger ?: new NullLogger();
4040
}
4141

42-
abstract public function getName(): string;
43-
4442
/**
4543
* Sets the maximum number of messages to send per second (0 to disable).
4644
*/

src/Symfony/Component/Mailer/Transport/SendmailTransport.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ public function send(RawMessage $message, SmtpEnvelope $envelope = null): ?SentM
7575

7676
public function getName(): string
7777
{
78-
return $this->transport->getName();
78+
if ($this->transport) {
79+
return $this->transport->getName();
80+
}
81+
82+
return 'smtp://sendmail';
7983
}
8084

8185
protected function doSend(SentMessage $message): void

0 commit comments

Comments
 (0)
0