File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -45,13 +45,14 @@ public function __construct(ImapTokenizer $tokenizer)
4545 */
4646 public function next (): Data |Token |Response |null
4747 {
48- // Load the first token.
48+ // Attempt to load the first token.
4949 if (! $ this ->currentToken ) {
5050 $ this ->advance ();
5151 }
5252
53+ // No token was found, return null.
5354 if (! $ this ->currentToken ) {
54- throw new ImapParserException ( ' Empty response ' ) ;
55+ return null ;
5556 }
5657
5758 // If the token indicates the beginning of a list, parse it.
Original file line number Diff line number Diff line change 33use DirectoryTree \ImapEngine \Connection \ImapConnection ;
44use DirectoryTree \ImapEngine \Connection \Streams \FakeStream ;
55use DirectoryTree \ImapEngine \Exceptions \ImapCommandException ;
6+ use DirectoryTree \ImapEngine \Exceptions \ImapConnectionException ;
67use DirectoryTree \ImapEngine \Exceptions \ImapConnectionFailedException ;
7- use DirectoryTree \ImapEngine \Exceptions \ImapParserException ;
88use DirectoryTree \ImapEngine \Support \Str ;
99
1010test ('connect success ' , function () {
681681
682682 expect (function () use ($ connection ) {
683683 iterator_to_array ($ connection ->idle (30 ));
684- })->toThrow (ImapParserException ::class);
684+ })->toThrow (ImapConnectionException ::class);
685685
686686 $ stream ->assertWritten ('TAG1 IDLE ' );
687687});
You can’t perform that action at this time.
0 commit comments