public function getThread(): array
    {
        \set_error_handler(static function () {});

        /** @var array|false $tree */
        $tree = \imap_thread($this->resource->getStream());

        \restore_error_handler();

        return false !== $tree ? $tree : [];
    }