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 -4
View File
@@ -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());
}
}