Skip to content

Commit f561668

Browse files
committed
Change return type of inReplyTo to be array of strings
1 parent 4e2e8ff commit f561668

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/HasParsedMessage.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,19 @@ public function replyTo(): ?Address
8080
}
8181

8282
/**
83-
* Get the IN-REPLY-TO address.
83+
* Get the IN-REPLY-TO message identifier(s).
84+
*
85+
* @return string[]
8486
*/
85-
public function inReplyTo(): ?Address
87+
public function inReplyTo(): array
8688
{
87-
return head($this->addresses(HeaderConsts::IN_REPLY_TO)) ?: null;
89+
$parts = $this->header(HeaderConsts::IN_REPLY_TO)?->getParts() ?? [];
90+
91+
$values = array_map(function (IHeaderPart $part) {
92+
return $part->getValue();
93+
}, $parts);
94+
95+
return array_values(array_filter($values));
8896
}
8997

9098
/**

src/MessageInterface.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ public function messageId(): ?string;
4646
public function replyTo(): ?Address;
4747

4848
/**
49-
* Get the 'In-Reply-To' address.
49+
* Get the 'In-Reply-To' message identifier(s).
50+
*
51+
* @return string[]
5052
*/
51-
public function inReplyTo(): ?Address;
53+
public function inReplyTo(): array;
5254

5355
/**
5456
* Get the 'To' addresses.

0 commit comments

Comments
 (0)