javanile / php-imap2

PHP IMAP with OAUTH2
https://php-imap2.javanile.org/
GNU General Public License v3.0
48 stars 28 forks source link

Mailbox->getSubscribed() and others call deleteFolder() and imap_deletemailbox() #61

Open MikeyF-Anovia opened 6 months ago

MikeyF-Anovia commented 6 months ago

In php-imap2/src/Mailbox.php line 322+ the functions getSubscribed, listSubscribed, subscribe, unsubscribe all call deleteFolder() and imap_deletemailbox(). This seems odd to me. Is that correct?

public static function getSubscribed($imap, $mailbox)
{
    if (is_a($imap, Connection::class)) {
        $client = $imap->getClient();

        return $client->deleteFolder($mailbox);
    }

    return imap_deletemailbox($imap, $mailbox);
}
williamdes commented 6 months ago

It's unclear what you are trying to achieve First guess it's php 8 support

MikeyF-Anovia commented 6 months ago

I am trying to achieve understanding as to why 5 different functions all call the same code, which is $client->deleteFolder($mailbox) or imap_deletemailbox($imap, $mailbox) when that is not the purpose of those functions.

It looks like a bug, or several, to me.