public function getMailbox(string $name): MailboxInterface
    {
        if (false === $this->hasMailbox($name)) {
            throw new MailboxDoesNotExistException(\sprintf('Mailbox name "%s" does not exist', $name));
        }

        return new Mailbox($this->resource, $name, $this->mailboxNames[$name]);
    }
public function getMailbox(string $name): MailboxInterface
    {
        if (false === $this->hasMailbox($name)) {
            throw new MailboxDoesNotExistException(\sprintf('Mailbox name "%s" does not exist', $name));
        }

        return new Mailbox($this->resource, $name, $this->mailboxNames[$name]);
    }
public function getMailbox ( string $ name ) : MailboxInterface { if ( false === $ this -> hasMailbox ( $ name ) ) { throw new MailboxDoesNotExistException ( \ sprintf ( 'Mailbox name "%s" does not exist' , $ name ) ) ; } return new Mailbox ( $ this -> resource , $ name , $ this -> mailboxNames [ $ name ] ) ; }
Get a mailbox by its name.

@param string $name Mailbox name

@throws MailboxDoesNotExistException If mailbox does not exist

@return MailboxInterface
Get a mailbox by its name .