public function getMessageSequence(string $sequence): MessageIteratorInterface
    {
        \imap_errors();

        $overview = \imap_fetch_overview($this->resource->getStream(), $sequence, \FT_UID);
        if (\is_array($overview) && [] !== $overview) {
            $messageNumbers = \array_column($overview, 'uid');
        } else {
            if (false !== \imap_last_error()) {
                throw new InvalidSearchCriteriaException(\sprintf('Invalid sequence [%s]', $sequence));
            }

            $messageNumbers = [];
        }

        return new MessageIterator($this->resource, $messageNumbers);
    }
public function getMessageSequence(string $sequence): MessageIteratorInterface
    {
        \imap_errors();

        $overview = \imap_fetch_overview($this->resource->getStream(), $sequence, \FT_UID);
        if (\is_array($overview) && [] !== $overview) {
            $messageNumbers = \array_column($overview, 'uid');
        } else {
            if (false !== \imap_last_error()) {
                throw new InvalidSearchCriteriaException(\sprintf('Invalid sequence [%s]', $sequence));
            }

            $messageNumbers = [];
        }

        return new MessageIterator($this->resource, $messageNumbers);
    }
public function getMessageSequence ( string $ sequence ) : MessageIteratorInterface { \ imap_errors ( ) ; $ overview = \ imap_fetch_overview ( $ this -> resource -> getStream ( ) , $ sequence , \ FT_UID ) ; if ( \ is_array ( $ overview ) && [ ] !== $ overview ) { $ messageNumbers = \ array_column ( $ overview , 'uid' ) ; } else { if ( false !== \ imap_last_error ( ) ) { throw new InvalidSearchCriteriaException ( \ sprintf ( 'Invalid sequence [%s]' , $ sequence ) ) ; } $ messageNumbers = [ ] ; } return new MessageIterator ( $ this -> resource , $ messageNumbers ) ; }
Get message iterator for a sequence.

@param string $sequence Message numbers

@return MessageIteratorInterface
Get message iterator for a sequence .