setMailbox($this); } } /** * {@inheritDoc} */ public function config(?string $key = null, mixed $default = null): mixed { if (is_null($key)) { return $this->config; } return data_get($this->config, $key, $default); } /** * {@inheritDoc} */ public function connection(): ConnectionInterface { throw new Exception('Unsupported.'); } /** * {@inheritDoc} */ public function connected(): bool { return true; } /** * {@inheritDoc} */ public function reconnect(): void { // Do nothing. } /** * {@inheritDoc} */ public function connect(?ConnectionInterface $connection = null): void { // Do nothing. } /** * {@inheritDoc} */ public function disconnect(): void { // Do nothing. } /** * {@inheritDoc} */ public function inbox(): FolderInterface { return $this->folders()->findOrFail('inbox'); } /** * {@inheritDoc} */ public function folders(): FolderRepositoryInterface { return new FakeFolderRepository($this, $this->folders); } /** * {@inheritDoc} */ public function capabilities(): array { return $this->capabilities; } /** * {@inheritDoc} */ public function select(FolderInterface $folder, bool $force = false): void { $this->selected = $folder; } /** * {@inheritDoc} */ public function selected(FolderInterface $folder): bool { return $this->selected?->is($folder) ?? false; } }