refactor: CommandStatusResult

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-09-25 12:06:46 -04:00
parent 3ea76f34fb
commit 1ce2013c07
13 changed files with 163 additions and 76 deletions
@@ -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());
}
}