generated from Nodarx/template
feat: initial version
Signed-off-by: Sebastian Krupinski <root@LAPTOP-7DVOR6NC>
This commit was merged in pull request #1.
This commit is contained in:
39
lib/Service/Remote/Command/StreamFetchCommand.php
Normal file
39
lib/Service/Remote/Command/StreamFetchCommand.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace KTXM\ProviderImapMail\Service\Remote\Command;
|
||||
|
||||
use Gricob\IMAP\Protocol\Command\Command;
|
||||
use Gricob\IMAP\Protocol\Command\Argument\ParenthesizedList;
|
||||
use Gricob\IMAP\Protocol\Command\Argument\SequenceSet;
|
||||
|
||||
/**
|
||||
* Streaming single-message fetch command.
|
||||
*
|
||||
* Wraps gricob's UID FETCH for one or more UIDs with a configurable item list.
|
||||
* Used inside ImapClientWrapper::streamMessages() (one UID per call) and
|
||||
* ImapClientWrapper::fetchMessages() (variadic UIDs for bulk prefetch).
|
||||
*
|
||||
* Example: UID FETCH 42 (FLAGS ENVELOPE INTERNALDATE BODYSTRUCTURE BODY[])
|
||||
*/
|
||||
final readonly class StreamFetchCommand extends Command
|
||||
{
|
||||
/**
|
||||
* @param int[] $uids One or more UIDs; formatted as "1,3,7" by SequenceSet
|
||||
* @param string[] $items IMAP fetch data items (e.g. 'FLAGS', 'ENVELOPE', 'BODY[]')
|
||||
*/
|
||||
public function __construct(array $uids, array $items)
|
||||
{
|
||||
parent::__construct(
|
||||
'UID FETCH',
|
||||
new SequenceSet(...$uids),
|
||||
new ParenthesizedList($items),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user