generated from Nodarx/template
refactor: mailbox status names
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace KTXM\ProviderImap\Client;
|
||||
|
||||
use KTXM\ProviderImap\Client\Result\StatusResult;
|
||||
use KTXM\ProviderImap\Client\Result\MailboxStatusResult;
|
||||
|
||||
final class Mailbox
|
||||
{
|
||||
@@ -18,13 +18,13 @@ final class Mailbox
|
||||
private readonly array $attributes,
|
||||
private readonly int $messages = 0,
|
||||
private readonly int $unread = 0,
|
||||
private readonly ?int $state = null,
|
||||
private readonly ?int $uidValidity = null,
|
||||
private readonly int $recent = 0,
|
||||
private readonly array $flags = [],
|
||||
private readonly bool $readOnly = true,
|
||||
) {}
|
||||
|
||||
public function fromStatus(StatusResult $status): self
|
||||
public function fromStatus(MailboxStatusResult $status): self
|
||||
{
|
||||
return new self(
|
||||
$this->name,
|
||||
@@ -32,7 +32,7 @@ final class Mailbox
|
||||
$this->attributes,
|
||||
$status->messages() ?? $this->messages,
|
||||
$status->unseen() ?? $this->unread,
|
||||
$status->state() ?? $this->state,
|
||||
$status->uidValidity() ?? $this->uidValidity,
|
||||
$this->recent,
|
||||
$this->flags,
|
||||
$this->readOnly,
|
||||
@@ -57,9 +57,9 @@ final class Mailbox
|
||||
return $this->attributes;
|
||||
}
|
||||
|
||||
public function state(): ?int
|
||||
public function uidValidity(): ?int
|
||||
{
|
||||
return $this->state;
|
||||
return $this->uidValidity;
|
||||
}
|
||||
|
||||
public function messages(): int
|
||||
|
||||
Reference in New Issue
Block a user