1
0
mirror of https://github.com/freescout-helpdesk/freescout.git synced 2024-11-23 19:02:46 +01:00

Allow to call \Webklex\PHPIMAP\Message::make() without specifying uid

This commit is contained in:
FreeScout 2024-06-10 01:27:24 -07:00
parent 4ee876c134
commit 1fd00def95
2 changed files with 5 additions and 3 deletions

View File

@ -78,7 +78,7 @@ class TestWebklex extends Command
$client = \MailHelper::getMailboxClient($mailbox);
$client->openFolder("INBOX");
$message = Message::make($this->option('uid'), null, $client, $raw_header, $raw_body, [0 => "\\Seen"], IMAP::ST_UID);
$message = Message::make(/*$this->option('uid')*/null, null, $client, $raw_header, $raw_body, [/*0 => "\\Seen"*/], IMAP::ST_UID);
$this->line('Headers: ');
$this->info($message->getHeader()->raw);

View File

@ -246,7 +246,7 @@ class Message {
* @throws Exceptions\RuntimeException
* @throws Exceptions\MessageNotFoundException
*/
public static function make(int $uid, $msglist, Client $client, string $raw_header, string $raw_body, array $raw_flags, $fetch_options = null, $sequence = null): Message {
public static function make(/*int*/ $uid, $msglist, Client $client, string $raw_header, string $raw_body, array $raw_flags, $fetch_options = null, $sequence = null): Message {
$reflection = new ReflectionClass(self::class);
/** @var self $instance */
$instance = $reflection->newInstanceWithoutConstructor();
@ -265,7 +265,9 @@ class Message {
$instance->setFetchOption($fetch_options);
$instance->setClient($client);
$instance->setSequenceId($uid, $msglist);
if ($uid !== null) {
$instance->setSequenceId($uid, $msglist);
}
$instance->parseRawHeader($raw_header);
$instance->parseRawFlags($raw_flags);