Skip to content

Commit

Permalink
bug #32963 [Mailer] fix getName() when transport is null (xabbuh)
Browse files Browse the repository at this point in the history
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] fix getName() when transport is null

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

ee4192e fix getName() when transport is null
  • Loading branch information
fabpot committed Aug 6, 2019
2 parents 6723bb9 + ee4192e commit d94c4b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/Symfony/Component/Mailer/Transport/AbstractTransport.php
Expand Up @@ -39,8 +39,6 @@ public function __construct(EventDispatcherInterface $dispatcher = null, LoggerI
$this->logger = $logger ?: new NullLogger();
}

abstract public function getName(): string;

/**
* Sets the maximum number of messages to send per second (0 to disable).
*/
Expand Down
6 changes: 5 additions & 1 deletion src/Symfony/Component/Mailer/Transport/SendmailTransport.php
Expand Up @@ -75,7 +75,11 @@ public function send(RawMessage $message, SmtpEnvelope $envelope = null): ?SentM

public function getName(): string
{
return $this->transport->getName();
if ($this->transport) {
return $this->transport->getName();
}

return 'smtp://sendmail';
}

protected function doSend(SentMessage $message): void
Expand Down

0 comments on commit d94c4b4

Please sign in to comment.