private static function isMailboxOpen(MailboxInterface $mailbox, $resource): bool
    {
        $currentMailboxName = $mailbox->getFullEncodedName();
        if ($currentMailboxName === self::$lastMailboxUsedCache) {
            return true;
        }

        self::$lastMailboxUsedCache = null;
        $check                      = \imap_check($resource);
        $return                     = false !== $check && $check->Mailbox === $currentMailboxName;

        if (true === $return) {
            self::$lastMailboxUsedCache = $currentMailboxName;
        }

        return $return;
    }
private static function isMailboxOpen(MailboxInterface $mailbox, $resource): bool
    {
        $currentMailboxName = $mailbox->getFullEncodedName();
        if ($currentMailboxName === self::$lastMailboxUsedCache) {
            return true;
        }

        self::$lastMailboxUsedCache = null;
        $check                      = \imap_check($resource);
        $return                     = false !== $check && $check->Mailbox === $currentMailboxName;

        if (true === $return) {
            self::$lastMailboxUsedCache = $currentMailboxName;
        }

        return $return;
    }
private static function isMailboxOpen ( MailboxInterface $ mailbox , $ resource ) : bool { $ currentMailboxName = $ mailbox -> getFullEncodedName ( ) ; if ( $ currentMailboxName === self :: $ lastMailboxUsedCache ) { return true ; } self :: $ lastMailboxUsedCache = null ; $ check = \ imap_check ( $ resource ) ; $ return = false !== $ check && $ check -> Mailbox === $ currentMailboxName ; if ( true === $ return ) { self :: $ lastMailboxUsedCache = $ currentMailboxName ; } return $ return ; }
Check whether the current mailbox is open.

@param mixed $resource
Check whether the current mailbox is open .