generated from Nodarx/template
refactor: use custom imap client
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
47
lib/Client/Command/CopyCommand.php
Normal file
47
lib/Client/Command/CopyCommand.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace KTXM\ProviderImap\Client\Command;
|
||||
|
||||
use KTXM\ProviderImap\Client\Command\Result\MessageTransferResult;
|
||||
use KTXM\ProviderImap\Client\FetchTarget;
|
||||
use KTXM\ProviderImap\Client\Protocol\RequestFrame;
|
||||
use KTXM\ProviderImap\Client\Protocol\ResponseStream;
|
||||
use KTXM\ProviderImap\Client\SequenceSet;
|
||||
use KTXM\ProviderImap\Client\SessionContext;
|
||||
|
||||
/**
|
||||
* @implements CommandInterface<MessageTransferResult>
|
||||
*/
|
||||
final class CopyCommand implements CommandInterface
|
||||
{
|
||||
private readonly MessageTransferCommand $command;
|
||||
|
||||
public function __construct(
|
||||
FetchTarget|string|SequenceSet|null $target = null,
|
||||
string $destinationMailbox = '',
|
||||
) {
|
||||
$this->command = new MessageTransferCommand('COPY', $target, $destinationMailbox);
|
||||
}
|
||||
|
||||
public function name(): string
|
||||
{
|
||||
return $this->command->name();
|
||||
}
|
||||
|
||||
public function allowedStates(): array
|
||||
{
|
||||
return $this->command->allowedStates();
|
||||
}
|
||||
|
||||
public function encode(string $tag, SessionContext $context): RequestFrame
|
||||
{
|
||||
return $this->command->encode($tag, $context);
|
||||
}
|
||||
|
||||
public function handle(ResponseStream $responses, SessionContext $context): MessageTransferResult
|
||||
{
|
||||
return $this->command->handle($responses, $context);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user