Skip to content

Commit 51d6a7f

Browse files
committed
Merge branch '6.4' into 7.0
* 6.4: Revert "fix PHP 7 compatibility"
2 parents be07d1d + 99add8a commit 51d6a7f

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

Message.php

+2-9
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,11 @@ public function toIterable(): iterable
124124

125125
public function ensureValidity(): void
126126
{
127-
$to = (null !== $header = $this->headers->get('To')) ? $header->getBody() : null;
128-
$cc = (null !== $header = $this->headers->get('Cc')) ? $header->getBody() : null;
129-
$bcc = (null !== $header = $this->headers->get('Bcc')) ? $header->getBody() : null;
130-
131-
if (!$to && !$cc && !$bcc) {
127+
if (!$this->headers->get('To')?->getBody() && !$this->headers->get('Cc')?->getBody() && !$this->headers->get('Bcc')?->getBody()) {
132128
throw new LogicException('An email must have a "To", "Cc", or "Bcc" header.');
133129
}
134130

135-
$from = (null !== $header = $this->headers->get('From')) ? $header->getBody() : null;
136-
$sender = (null !== $header = $this->headers->get('Sender')) ? $header->getBody() : null;
137-
138-
if (!$from && !$sender) {
131+
if (!$this->headers->get('From')?->getBody() && !$this->headers->get('Sender')?->getBody()) {
139132
throw new LogicException('An email must have a "From" or a "Sender" header.');
140133
}
141134

0 commit comments

Comments
 (0)