generated from Nodarx/template
refactor: CommandStatusResult
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||
namespace KTXM\ProviderImap\Client\Protocol\Command;
|
||||
|
||||
use KTXM\ProviderImap\Client\Protocol\StringEncoder;
|
||||
use KTXM\ProviderImap\Client\Result\CommandStatusResult;
|
||||
use KTXM\ProviderImap\Client\Result\CommandCompletion;
|
||||
use KTXM\ProviderImap\Client\ImapException;
|
||||
use KTXM\ProviderImap\Client\Protocol\RequestFrame;
|
||||
use KTXM\ProviderImap\Client\Protocol\Response\TaggedResponse;
|
||||
@@ -14,7 +14,7 @@ use KTXM\ProviderImap\Client\Protocol\SessionContext;
|
||||
use KTXM\ProviderImap\Client\Protocol\SessionState;
|
||||
|
||||
/**
|
||||
* @implements CommandInterface<CommandStatusResult>
|
||||
* @implements CommandInterface<CommandCompletion>
|
||||
*/
|
||||
final class CreateCommand implements CommandInterface
|
||||
{
|
||||
@@ -42,7 +42,7 @@ final class CreateCommand implements CommandInterface
|
||||
return new RequestFrame(sprintf('CREATE %s', StringEncoder::quote($this->mailbox)));
|
||||
}
|
||||
|
||||
public function handle(ResponseStream $responses, SessionContext $context): CommandStatusResult
|
||||
public function handle(ResponseStream $responses, SessionContext $context): CommandCompletion
|
||||
{
|
||||
unset($context);
|
||||
|
||||
@@ -52,7 +52,7 @@ final class CreateCommand implements CommandInterface
|
||||
throw new ImapException('CREATE failed: ' . $response->text());
|
||||
}
|
||||
|
||||
return new CommandStatusResult($response->status(), $response->text());
|
||||
return new CommandCompletion($response->status(), $response->text());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||
namespace KTXM\ProviderImap\Client\Protocol\Command;
|
||||
|
||||
use KTXM\ProviderImap\Client\Protocol\StringEncoder;
|
||||
use KTXM\ProviderImap\Client\Result\CommandStatusResult;
|
||||
use KTXM\ProviderImap\Client\Result\CommandCompletion;
|
||||
use KTXM\ProviderImap\Client\ImapException;
|
||||
use KTXM\ProviderImap\Client\Protocol\RequestFrame;
|
||||
use KTXM\ProviderImap\Client\Protocol\Response\TaggedResponse;
|
||||
@@ -14,7 +14,7 @@ use KTXM\ProviderImap\Client\Protocol\SessionContext;
|
||||
use KTXM\ProviderImap\Client\Protocol\SessionState;
|
||||
|
||||
/**
|
||||
* @implements CommandInterface<CommandStatusResult>
|
||||
* @implements CommandInterface<CommandCompletion>
|
||||
*/
|
||||
final class DeleteCommand implements CommandInterface
|
||||
{
|
||||
@@ -42,7 +42,7 @@ final class DeleteCommand implements CommandInterface
|
||||
return new RequestFrame(sprintf('DELETE %s', StringEncoder::quote($this->mailbox)));
|
||||
}
|
||||
|
||||
public function handle(ResponseStream $responses, SessionContext $context): CommandStatusResult
|
||||
public function handle(ResponseStream $responses, SessionContext $context): CommandCompletion
|
||||
{
|
||||
if ($context->selectedMailbox() === $this->mailbox) {
|
||||
$context->setSelectedMailbox(null);
|
||||
@@ -55,7 +55,7 @@ final class DeleteCommand implements CommandInterface
|
||||
throw new ImapException('DELETE failed: ' . $response->text());
|
||||
}
|
||||
|
||||
return new CommandStatusResult($response->status(), $response->text());
|
||||
return new CommandCompletion($response->status(), $response->text());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||
namespace KTXM\ProviderImap\Client\Protocol\Command;
|
||||
|
||||
use KTXM\ProviderImap\Client\Protocol\StringEncoder;
|
||||
use KTXM\ProviderImap\Client\Result\CommandStatusResult;
|
||||
use KTXM\ProviderImap\Client\Result\CommandCompletion;
|
||||
use KTXM\ProviderImap\Client\ImapException;
|
||||
use KTXM\ProviderImap\Client\Protocol\RequestFrame;
|
||||
use KTXM\ProviderImap\Client\Protocol\Response\TaggedResponse;
|
||||
@@ -14,7 +14,7 @@ use KTXM\ProviderImap\Client\Protocol\SessionContext;
|
||||
use KTXM\ProviderImap\Client\Protocol\SessionState;
|
||||
|
||||
/**
|
||||
* @implements CommandInterface<CommandStatusResult>
|
||||
* @implements CommandInterface<CommandCompletion>
|
||||
*/
|
||||
final class LoginCommand implements CommandInterface
|
||||
{
|
||||
@@ -44,7 +44,7 @@ final class LoginCommand implements CommandInterface
|
||||
));
|
||||
}
|
||||
|
||||
public function handle(ResponseStream $responses, SessionContext $context): CommandStatusResult
|
||||
public function handle(ResponseStream $responses, SessionContext $context): CommandCompletion
|
||||
{
|
||||
foreach ($responses as $response) {
|
||||
if ($response instanceof TaggedResponse) {
|
||||
@@ -54,7 +54,7 @@ final class LoginCommand implements CommandInterface
|
||||
|
||||
$context->setState(SessionState::Authenticated);
|
||||
|
||||
return new CommandStatusResult($response->status(), $response->text());
|
||||
return new CommandCompletion($response->status(), $response->text());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace KTXM\ProviderImap\Client\Protocol\Command;
|
||||
|
||||
use KTXM\ProviderImap\Client\Result\CommandStatusResult;
|
||||
use KTXM\ProviderImap\Client\Result\CommandCompletion;
|
||||
use KTXM\ProviderImap\Client\ImapException;
|
||||
use KTXM\ProviderImap\Client\Protocol\RequestFrame;
|
||||
use KTXM\ProviderImap\Client\Protocol\Response\TaggedResponse;
|
||||
@@ -13,7 +13,7 @@ use KTXM\ProviderImap\Client\Protocol\SessionContext;
|
||||
use KTXM\ProviderImap\Client\Protocol\SessionState;
|
||||
|
||||
/**
|
||||
* @implements CommandInterface<CommandStatusResult>
|
||||
* @implements CommandInterface<CommandCompletion>
|
||||
*/
|
||||
final class LogoutCommand implements CommandInterface
|
||||
{
|
||||
@@ -38,7 +38,7 @@ final class LogoutCommand implements CommandInterface
|
||||
return new RequestFrame('LOGOUT');
|
||||
}
|
||||
|
||||
public function handle(ResponseStream $responses, SessionContext $context): CommandStatusResult
|
||||
public function handle(ResponseStream $responses, SessionContext $context): CommandCompletion
|
||||
{
|
||||
foreach ($responses as $response) {
|
||||
if ($response instanceof TaggedResponse) {
|
||||
@@ -50,7 +50,7 @@ final class LogoutCommand implements CommandInterface
|
||||
$context->setState(SessionState::Logout);
|
||||
$context->connection()->disconnect();
|
||||
|
||||
return new CommandStatusResult($response->status(), $response->text());
|
||||
return new CommandCompletion($response->status(), $response->text());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace KTXM\ProviderImap\Client\Protocol\Command;
|
||||
|
||||
use KTXM\ProviderImap\Client\Result\CommandStatusResult;
|
||||
use KTXM\ProviderImap\Client\Result\CommandCompletion;
|
||||
use KTXM\ProviderImap\Client\ImapException;
|
||||
use KTXM\ProviderImap\Client\Protocol\RequestFrame;
|
||||
use KTXM\ProviderImap\Client\Protocol\Response\TaggedResponse;
|
||||
@@ -13,7 +13,7 @@ use KTXM\ProviderImap\Client\Protocol\SessionContext;
|
||||
use KTXM\ProviderImap\Client\Protocol\SessionState;
|
||||
|
||||
/**
|
||||
* @implements CommandInterface<CommandStatusResult>
|
||||
* @implements CommandInterface<CommandCompletion>
|
||||
*/
|
||||
final class NoopCommand implements CommandInterface
|
||||
{
|
||||
@@ -38,7 +38,7 @@ final class NoopCommand implements CommandInterface
|
||||
return new RequestFrame('NOOP');
|
||||
}
|
||||
|
||||
public function handle(ResponseStream $responses, SessionContext $context): CommandStatusResult
|
||||
public function handle(ResponseStream $responses, SessionContext $context): CommandCompletion
|
||||
{
|
||||
unset($context);
|
||||
|
||||
@@ -48,7 +48,7 @@ final class NoopCommand implements CommandInterface
|
||||
throw new ImapException('NOOP failed: ' . $response->text());
|
||||
}
|
||||
|
||||
return new CommandStatusResult($response->status(), $response->text());
|
||||
return new CommandCompletion($response->status(), $response->text());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||
namespace KTXM\ProviderImap\Client\Protocol\Command;
|
||||
|
||||
use KTXM\ProviderImap\Client\Protocol\StringEncoder;
|
||||
use KTXM\ProviderImap\Client\Result\CommandStatusResult;
|
||||
use KTXM\ProviderImap\Client\Result\CommandCompletion;
|
||||
use KTXM\ProviderImap\Client\ImapException;
|
||||
use KTXM\ProviderImap\Client\Protocol\RequestFrame;
|
||||
use KTXM\ProviderImap\Client\Protocol\Response\TaggedResponse;
|
||||
@@ -14,7 +14,7 @@ use KTXM\ProviderImap\Client\Protocol\SessionContext;
|
||||
use KTXM\ProviderImap\Client\Protocol\SessionState;
|
||||
|
||||
/**
|
||||
* @implements CommandInterface<CommandStatusResult>
|
||||
* @implements CommandInterface<CommandCompletion>
|
||||
*/
|
||||
final class RenameCommand implements CommandInterface
|
||||
{
|
||||
@@ -47,7 +47,7 @@ final class RenameCommand implements CommandInterface
|
||||
));
|
||||
}
|
||||
|
||||
public function handle(ResponseStream $responses, SessionContext $context): CommandStatusResult
|
||||
public function handle(ResponseStream $responses, SessionContext $context): CommandCompletion
|
||||
{
|
||||
foreach ($responses as $response) {
|
||||
if ($response instanceof TaggedResponse) {
|
||||
@@ -59,7 +59,7 @@ final class RenameCommand implements CommandInterface
|
||||
$context->setSelectedMailbox($this->toMailbox);
|
||||
}
|
||||
|
||||
return new CommandStatusResult($response->status(), $response->text());
|
||||
return new CommandCompletion($response->status(), $response->text());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace KTXM\ProviderImap\Client\Protocol\Command;
|
||||
|
||||
use KTXM\ProviderImap\Client\Result\CommandStatusResult;
|
||||
use KTXM\ProviderImap\Client\Result\CommandCompletion;
|
||||
use KTXM\ProviderImap\Client\ImapException;
|
||||
use KTXM\ProviderImap\Client\Protocol\RequestFrame;
|
||||
use KTXM\ProviderImap\Client\Protocol\Response\TaggedResponse;
|
||||
@@ -13,7 +13,7 @@ use KTXM\ProviderImap\Client\Protocol\SessionContext;
|
||||
use KTXM\ProviderImap\Client\Protocol\SessionState;
|
||||
|
||||
/**
|
||||
* @implements CommandInterface<CommandStatusResult>
|
||||
* @implements CommandInterface<CommandCompletion>
|
||||
*/
|
||||
final class StartTlsCommand implements CommandInterface
|
||||
{
|
||||
@@ -34,7 +34,7 @@ final class StartTlsCommand implements CommandInterface
|
||||
return new RequestFrame('STARTTLS');
|
||||
}
|
||||
|
||||
public function handle(ResponseStream $responses, SessionContext $context): CommandStatusResult
|
||||
public function handle(ResponseStream $responses, SessionContext $context): CommandCompletion
|
||||
{
|
||||
foreach ($responses as $response) {
|
||||
if ($response instanceof TaggedResponse) {
|
||||
@@ -45,7 +45,7 @@ final class StartTlsCommand implements CommandInterface
|
||||
$context->connection()->upgradeToTls();
|
||||
$context->replaceCapabilities();
|
||||
|
||||
return new CommandStatusResult($response->status(), $response->text());
|
||||
return new CommandCompletion($response->status(), $response->text());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace KTXM\ProviderImap\Client\Protocol\Command;
|
||||
|
||||
use KTXM\ProviderImap\Client\Result\CommandStatusResult;
|
||||
use KTXM\ProviderImap\Client\Result\CommandCompletion;
|
||||
use KTXM\ProviderImap\Client\Protocol\Command\Argument\MessageTarget;
|
||||
use KTXM\ProviderImap\Client\Protocol\IdentifierMode;
|
||||
use KTXM\ProviderImap\Client\ImapException;
|
||||
@@ -16,7 +16,7 @@ use KTXM\ProviderImap\Client\Protocol\SessionContext;
|
||||
use KTXM\ProviderImap\Client\Protocol\SessionState;
|
||||
|
||||
/**
|
||||
* @implements CommandInterface<CommandStatusResult>
|
||||
* @implements CommandInterface<CommandCompletion>
|
||||
*/
|
||||
final class StoreCommand implements CommandInterface
|
||||
{
|
||||
@@ -82,7 +82,7 @@ final class StoreCommand implements CommandInterface
|
||||
));
|
||||
}
|
||||
|
||||
public function handle(ResponseStream $responses, SessionContext $context): CommandStatusResult
|
||||
public function handle(ResponseStream $responses, SessionContext $context): CommandCompletion
|
||||
{
|
||||
if ($context->selectedMailbox() === null) {
|
||||
throw new ImapException('STORE requires a selected mailbox.');
|
||||
@@ -94,7 +94,7 @@ final class StoreCommand implements CommandInterface
|
||||
throw new ImapException('STORE failed: ' . $response->text());
|
||||
}
|
||||
|
||||
return new CommandStatusResult($response->status(), $response->text());
|
||||
return new CommandCompletion($response->status(), $response->text());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user