Files
provider_imap/lib/Client/CommandFailedException.php
T

49 lines
1.0 KiB
PHP

<?php
declare(strict_types=1);
namespace KTXM\ProviderImap\Client;
/**
* A server-reported unsuccessful tagged command completion.
*/
final class CommandFailedException extends ImapException
{
/**
* @param ?array{name:string, arguments:list<string>, text:string} $responseCode
*/
public function __construct(
private readonly string $command,
private readonly string $status,
private readonly string $text,
private readonly ?array $responseCode = null,
) {
parent::__construct($command . ' failed: ' . $text);
}
public function command(): string
{
return $this->command;
}
public function status(): string
{
return $this->status;
}
public function text(): string
{
return $this->text;
}
/**
* The code from the tagged completion, if present.
*
* @return ?array{name:string, arguments:list<string>, text:string}
*/
public function responseCode(): ?array
{
return $this->responseCode;
}
}