Skip to content

Commit dc21bf5

Browse files
committed
reduce repetitive files_data check at Mail writer
1 parent a0c8df6 commit dc21bf5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Handler/Writer/Mail.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ public function shutdown() : void
4343
// Always provide events to mail as plaintext.
4444
$body = \implode(\PHP_EOL, $this->eventsToMail);
4545

46-
if (! empty($this->requestData['files_data'])) {
46+
if (empty($this->requestData['files_data'])) {
47+
$this->mail->setBody($body);
48+
} else {
4749
$mimePart = new MimePart($body);
4850
$mimePart->type = Mime::TYPE_TEXT;
4951
$mimePart->charset = 'utf-8';
@@ -64,11 +66,9 @@ public function shutdown() : void
6466
$body = $this->bodyAddPart($body, $upload);
6567
}
6668
}
67-
}
6869

69-
$this->mail->setBody($body);
70+
$this->mail->setBody($body);
7071

71-
if (! empty($this->requestData['files_data'])) {
7272
$headers = $this->mail->getHeaders();
7373
/** @var \Zend\Mail\Header\ContentType $contentTypeHeader */
7474
$contentTypeHeader = $headers->get('Content-Type');

0 commit comments

Comments
 (0)