We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 51b7788 commit 10983ccCopy full SHA for 10983cc
src/HasParsedMessage.php
@@ -28,9 +28,12 @@ trait HasParsedMessage
28
*/
29
public function date(): ?CarbonInterface
30
{
31
- $dateHeader = $this->header(HeaderConsts::DATE);
32
- if ($dateHeader instanceof DateHeader) {
33
- return Carbon::instance($dateHeader->getDateTime());
+ if (! $header = $this->header(HeaderConsts::DATE)) {
+ return null;
+ }
34
+
35
+ if ($header instanceof DateHeader) {
36
+ return Carbon::instance($header->getDateTime());
37
}
38
39
return null;
0 commit comments