fix getName() when transport is null

This commit is contained in:
Christian Flothmann 2019-08-05 22:07:36 +02:00
parent 233562f034
commit ee4192ebc7
2 changed files with 5 additions and 3 deletions

View File

@ -39,8 +39,6 @@ abstract class AbstractTransport implements TransportInterface
$this->logger = $logger ?: new NullLogger(); $this->logger = $logger ?: new NullLogger();
} }
abstract public function getName(): string;
/** /**
* Sets the maximum number of messages to send per second (0 to disable). * Sets the maximum number of messages to send per second (0 to disable).
*/ */

View File

@ -75,7 +75,11 @@ class SendmailTransport extends AbstractTransport
public function getName(): string public function getName(): string
{ {
return $this->transport->getName(); if ($this->transport) {
return $this->transport->getName();
}
return 'smtp://sendmail';
} }
protected function doSend(SentMessage $message): void protected function doSend(SentMessage $message): void