Skip to content

Commit

Permalink
Merge pull request #656 from barbushin/655-IMAP-connection-slow-using…
Browse files Browse the repository at this point in the history
…-PHP-8.1.x

#655: Add missing PHP 8.1 support
  • Loading branch information
Sebbo94BY committed Jan 10, 2022
2 parents a572a21 + 4d42207 commit e630d64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/PhpImap/Imap.php
Expand Up @@ -721,7 +721,7 @@ public static function open(
*/
public static function ping($imap_stream): bool
{
return \is_resource($imap_stream) && \imap_ping($imap_stream);
return (\is_resource($imap_stream) || $imap_stream instanceof \IMAP\Connection) && \imap_ping($imap_stream);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/PhpImap/Mailbox.php
Expand Up @@ -476,7 +476,7 @@ public function getImapStream(bool $forceConnection = true)

public function hasImapStream(): bool
{
return \is_resource($this->imapStream) && \imap_ping($this->imapStream);
return (\is_resource($this->imapStream) || $this->imapStream instanceof \IMAP\Connection) && \imap_ping($this->imapStream);
}

/**
Expand Down

0 comments on commit e630d64

Please sign in to comment.