Skip to content

Commit 8b7ac78

Browse files
authored
Merge pull request #27 from webfox/bugfix_reverse-isHtml-isText-logic
Fix isHtml, isText, and body methods
2 parents 8d1e4da + a369338 commit 8b7ac78

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/InboundEmail.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,23 +157,23 @@ public function forward($recipients)
157157
});
158158
}
159159

160-
public function body()
160+
public function body(): ?string
161161
{
162162
return $this->isHtml() ? $this->html() : $this->text();
163163
}
164164

165-
public function isHtml()
165+
public function isHtml(): bool
166166
{
167-
return empty($this->html());
167+
return ! empty($this->html());
168168
}
169169

170-
public function isText()
170+
public function isText(): bool
171171
{
172-
return empty($this->text());
172+
return ! empty($this->text());
173173
}
174174

175175
public function isValid(): bool
176176
{
177-
return $this->from() !== '' && ($this->text() !== '' || $this->html() !== '');
177+
return $this->from() !== '' && ($this->isText() || $this->isHtml());
178178
}
179179
}

0 commit comments

Comments
 (0)