private function initMailboxNames(): void
    {
        if (null !== $this->mailboxNames) {
            return;
        }

        $this->mailboxNames = [];
        $mailboxesInfo      = \imap_getmailboxes($this->resource->getStream(), $this->server, '*');
        if (!\is_array($mailboxesInfo)) {
            throw new ImapGetmailboxesException('imap_getmailboxes failed');
        }

        foreach ($mailboxesInfo as $mailboxInfo) {
            $name                      = \mb_convert_encoding(\str_replace($this->server, '', $mailboxInfo->name), 'UTF-8', 'UTF7-IMAP');
            $this->mailboxNames[$name] = $mailboxInfo;
        }
    }
private function initMailboxNames(): void
    {
        if (null !== $this->mailboxNames) {
            return;
        }

        $this->mailboxNames = [];
        $mailboxesInfo      = \imap_getmailboxes($this->resource->getStream(), $this->server, '*');
        if (!\is_array($mailboxesInfo)) {
            throw new ImapGetmailboxesException('imap_getmailboxes failed');
        }

        foreach ($mailboxesInfo as $mailboxInfo) {
            $name                      = \mb_convert_encoding(\str_replace($this->server, '', $mailboxInfo->name), 'UTF-8', 'UTF7-IMAP');
            $this->mailboxNames[$name] = $mailboxInfo;
        }
    }
private function initMailboxNames ( ) : void { if ( null !== $ this -> mailboxNames ) { return ; } $ this -> mailboxNames = [ ] ; $ mailboxesInfo = \ imap_getmailboxes ( $ this -> resource -> getStream ( ) , $ this -> server , '*' ) ; if ( ! \ is_array ( $ mailboxesInfo ) ) { throw new ImapGetmailboxesException ( 'imap_getmailboxes failed' ) ; } foreach ( $ mailboxesInfo as $ mailboxInfo ) { $ name = \ mb_convert_encoding ( \ str_replace ( $ this -> server , '' , $ mailboxInfo -> name ) , 'UTF-8' , 'UTF7-IMAP' ) ; $ this -> mailboxNames [ $ name ] = $ mailboxInfo ; } }
Get mailbox names.
Get mailbox names .