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/Client/Protocol/Command/AppendCommand.php
Normal file
39
lib/Client/Protocol/Command/AppendCommand.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Gricob\IMAP\Protocol\Command;
|
||||
|
||||
use DateTimeInterface;
|
||||
use Gricob\IMAP\Protocol\Command\Argument\DateTime;
|
||||
use Gricob\IMAP\Protocol\Command\Argument\QuotedString;
|
||||
use Gricob\IMAP\Protocol\Command\Argument\SynchronizingLiteral;
|
||||
use Gricob\IMAP\Protocol\Command\Argument\ParenthesizedList;
|
||||
|
||||
final readonly class AppendCommand extends Command implements Continuable
|
||||
{
|
||||
/**
|
||||
* @param list<string>|null $flags
|
||||
*/
|
||||
public function __construct(
|
||||
string $mailboxName,
|
||||
private string $message,
|
||||
?array $flags,
|
||||
?DateTimeInterface $internalDate
|
||||
) {
|
||||
parent::__construct(
|
||||
'APPEND',
|
||||
...array_filter([
|
||||
new QuotedString($mailboxName),
|
||||
ParenthesizedList::tryFrom($flags),
|
||||
DateTime::tryFrom($internalDate),
|
||||
new SynchronizingLiteral($this->message),
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
public function continue(): string
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user