1111use DirectoryTree \ImapEngine \Exceptions \ConnectionFailedException ;
1212use DirectoryTree \ImapEngine \Exceptions \Exception ;
1313use DirectoryTree \ImapEngine \Support \Str ;
14- use Illuminate \Support \Arr ;
1514
1615class ImapConnection extends Connection
1716{
@@ -69,8 +68,6 @@ public function logout(): ?TaggedResponse
6968
7069 try {
7170 $ this ->send ('LOGOUT ' , tag: $ tag );
72-
73- return $ this ->nextTaggedResponse ($ tag );
7471 } catch (Exception ) {
7572 // Do nothing.
7673 }
@@ -101,7 +98,7 @@ public function examine(string $folder = 'INBOX'): ResponseCollection
10198 */
10299 protected function examineOrSelect (string $ command = 'EXAMINE ' , string $ folder = 'INBOX ' ): ResponseCollection
103100 {
104- $ this ->send ($ command , Str::literal ($ folder ), $ tag );
101+ $ this ->send ($ command , [ Str::literal ($ folder )] , $ tag );
105102
106103 $ this ->assertTaggedResponse ($ tag );
107104
@@ -130,7 +127,7 @@ public function status(string $folder = 'INBOX', array $arguments = ['MESSAGES',
130127 */
131128 public function create (string $ folder ): ResponseCollection
132129 {
133- $ this ->send ('CREATE ' , Str::literal ($ folder ), $ tag );
130+ $ this ->send ('CREATE ' , [ Str::literal ($ folder )] , $ tag );
134131
135132 $ this ->assertTaggedResponse ($ tag );
136133
@@ -144,7 +141,7 @@ public function create(string $folder): ResponseCollection
144141 */
145142 public function delete (string $ folder ): TaggedResponse
146143 {
147- $ this ->send ('DELETE ' , Str::literal ($ folder ), tag: $ tag );
144+ $ this ->send ('DELETE ' , [ Str::literal ($ folder )] , tag: $ tag );
148145
149146 return $ this ->assertTaggedResponse ($ tag );
150147 }
@@ -164,7 +161,7 @@ public function rename(string $oldPath, string $newPath): TaggedResponse
164161 */
165162 public function subscribe (string $ folder ): TaggedResponse
166163 {
167- $ this ->send ('SUBSCRIBE ' , Str::literal ($ folder ), tag: $ tag );
164+ $ this ->send ('SUBSCRIBE ' , [ Str::literal ($ folder )] , tag: $ tag );
168165
169166 return $ this ->assertTaggedResponse ($ tag );
170167 }
@@ -174,7 +171,7 @@ public function subscribe(string $folder): TaggedResponse
174171 */
175172 public function unsubscribe (string $ folder ): TaggedResponse
176173 {
177- $ this ->send ('UNSUBSCRIBE ' , Str::literal ($ folder ), tag: $ tag );
174+ $ this ->send ('UNSUBSCRIBE ' , [ Str::literal ($ folder )] , tag: $ tag );
178175
179176 return $ this ->assertTaggedResponse ($ tag );
180177 }
@@ -203,7 +200,7 @@ public function append(string $folder, string $message, ?array $flags = null, ?s
203200 $ tokens [] = Str::literal ($ folder );
204201
205202 if ($ flags ) {
206- $ tokens [] = $ this -> escapeList ($ flags );
203+ $ tokens [] = Str:: list ($ flags );
207204 }
208205
209206 if ($ date ) {
@@ -254,7 +251,7 @@ public function store(array|string $flags, array|int $from, ?int $to = null, ?st
254251 {
255252 $ set = Str::set ($ from , $ to );
256253
257- $ flags = $ this -> escapeList (Arr:: wrap ( $ flags) );
254+ $ flags = Str:: list (( array ) $ flags );
258255
259256 $ item = ($ mode == '- ' ? '- ' : '+ ' ).(is_null ($ item ) ? 'FLAGS ' : $ item ).($ silent ? '.SILENT ' : '' );
260257
0 commit comments