Skip to content

Commit 99add8a

Browse files
committed
Revert "fix PHP 7 compatibility"
This reverts commit c5c6f08a7113454ab5aaee99cdcbb2f0fcca94c6.
1 parent 35f0ff4 commit 99add8a

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

Diff for: Message.php

+2-9
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,11 @@ public function toIterable(): iterable
130130
*/
131131
public function ensureValidity()
132132
{
133-
$to = (null !== $header = $this->headers->get('To')) ? $header->getBody() : null;
134-
$cc = (null !== $header = $this->headers->get('Cc')) ? $header->getBody() : null;
135-
$bcc = (null !== $header = $this->headers->get('Bcc')) ? $header->getBody() : null;
136-
137-
if (!$to && !$cc && !$bcc) {
133+
if (!$this->headers->get('To')?->getBody() && !$this->headers->get('Cc')?->getBody() && !$this->headers->get('Bcc')?->getBody()) {
138134
throw new LogicException('An email must have a "To", "Cc", or "Bcc" header.');
139135
}
140136

141-
$from = (null !== $header = $this->headers->get('From')) ? $header->getBody() : null;
142-
$sender = (null !== $header = $this->headers->get('Sender')) ? $header->getBody() : null;
143-
144-
if (!$from && !$sender) {
137+
if (!$this->headers->get('From')?->getBody() && !$this->headers->get('Sender')?->getBody()) {
145138
throw new LogicException('An email must have a "From" or a "Sender" header.');
146139
}
147140

0 commit comments

Comments
 (0)