*/ public array $mails = []; /** @var array */ public array $seen = []; public function isConfigured(): bool { return $this->configured; } /** * What a test wants the check to answer, if not the obvious. * * @var array{ok: bool, message: string, unseen: int|null}|null */ public array|null $checkAnswer = null; public function check(): array { return $this->checkAnswer ?? [ 'ok' => $this->configured, 'message' => $this->configured ? '' : 'not configured', 'unseen' => $this->configured ? count($this->mails) : null, ]; } public function fetch(int $limit = 50): array { return array_slice($this->mails, 0, $limit); } public function markSeen(string $uid): void { $this->seen[] = $uid; } }