Skip to content

Commit 1c0fe56

Browse files
committed
Add RFC links
1 parent c47006f commit 1c0fe56

File tree

1 file changed

+140
-35
lines changed

1 file changed

+140
-35
lines changed

src/Connection/ConnectionInterface.php

Lines changed: 140 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ interface ConnectionInterface
1010
{
1111
/**
1212
* Open a new connection.
13+
*
14+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-state-and-flow-diagram
1315
*/
1416
public function connect(string $host, ?int $port = null): void;
1517

@@ -19,154 +21,257 @@ public function connect(string $host, ?int $port = null): void;
1921
public function connected(): bool;
2022

2123
/**
24+
* Send a "LOGIN" command.
25+
*
2226
* Login to a new session.
27+
*
28+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-login-command
2329
*/
2430
public function login(string $user, string $password): TaggedResponse;
2531

2632
/**
33+
* Send a "LOGOUT" command.
34+
*
2735
* Logout of the current server session.
36+
*
37+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-logout-command
2838
*/
2939
public function logout(): ?TaggedResponse;
3040

3141
/**
42+
* Send an "AUTHENTICATE" command.
43+
*
3244
* Authenticate the current session.
45+
*
46+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-authenticate-command
3347
*/
3448
public function authenticate(string $user, string $token): TaggedResponse;
3549

3650
/**
37-
* Send idle command.
51+
* Send a "STARTTLS" command.
52+
*
53+
* Upgrade the current plaintext connection to a secure TLS-encrypted connection.
54+
*
55+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-starttls-command
56+
*/
57+
public function startTls(): void;
58+
59+
/**
60+
* Send an "IDLE" command.
61+
*
62+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-idle-command
3863
*/
3964
public function idle(): void;
4065

4166
/**
42-
* Send done command.
67+
* Send a "DONE" command.
68+
*
69+
* @see https://datatracker.ietf.org/doc/html/rfc9051#section-6.3.13
4370
*/
4471
public function done(): void;
4572

4673
/**
47-
* Send noop command.
74+
* Send a "NOOP" command.
75+
*
76+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-noop-command
4877
*/
4978
public function noop(): TaggedResponse;
5079

5180
/**
81+
* Send a "EXPUNGE" command.
82+
*
5283
* Apply session saved changes to the server.
84+
*
85+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-expunge-command
5386
*/
5487
public function expunge(): ResponseCollection;
5588

5689
/**
57-
* Get the mailboxes available capabilities.
90+
* Send a "CAPABILITY" command.
91+
*
92+
* Get the mailbox's available capabilities.
93+
*
94+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-capability-command
5895
*/
5996
public function capability(): UntaggedResponse;
6097

6198
/**
99+
* Send a "SEARCH" command.
100+
*
62101
* Execute a search request.
102+
*
103+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-search-command
63104
*/
64105
public function search(array $params): UntaggedResponse;
65106

66107
/**
108+
* Send a "FETCH" command.
109+
*
67110
* Exchange identification information.
68111
*
69112
* @see https://datatracker.ietf.org/doc/html/rfc2971.
70113
*/
71114
public function id(?array $ids = null): UntaggedResponse;
72115

73116
/**
117+
* Send a "FETCH UID" command.
118+
*
74119
* Fetch message UIDs using the given message numbers.
120+
*
121+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-uid-command
75122
*/
76-
public function uids(int|array $msgns): ResponseCollection;
123+
public function uid(int|array $msgns): ResponseCollection;
77124

78125
/**
79-
* Fetch message contents.
126+
* Send a "FETCH BODY[TEXT]" command.
127+
*
128+
* Fetch message text contents.
129+
*
130+
* @see https://datatracker.ietf.org/doc/html/rfc9051#section-6.4.5-9.9
80131
*/
81-
public function contents(int|array $ids, bool $peek = true): ResponseCollection;
132+
public function text(int|array $ids, bool $peek = true): ResponseCollection;
82133

83134
/**
135+
* Send a "FETCH BODY[HEADER]" command.
136+
*
84137
* Fetch message headers.
138+
*
139+
* @see https://datatracker.ietf.org/doc/html/rfc9051#section-6.4.5-9.9
85140
*/
86-
public function headers(int|array $ids, bool $peek = true): ResponseCollection;
141+
public function header(int|array $ids, bool $peek = true): ResponseCollection;
87142

88143
/**
89-
* Fetch message flags.
144+
* Send a "FETCH FLAGS" command.
145+
*
146+
* Fetch a message flags.
147+
*
148+
* @see https://datatracker.ietf.org/doc/html/rfc9051#section-6.4.5-9.17
90149
*/
91150
public function flags(int|array $ids): ResponseCollection;
92151

93152
/**
153+
* Send a "RFC822.SIZE" command.
154+
*
94155
* Fetch message sizes.
156+
*
157+
* @see https://datatracker.ietf.org/doc/html/rfc9051#section-6.4.5-9.21
95158
*/
96159
public function sizes(int|array $ids): ResponseCollection;
97160

98161
/**
99-
* Select the given folder.
162+
* Send a "SELECT" command.
163+
*
164+
* Select the specified folder.
165+
*
166+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-select-command
100167
*/
101-
public function selectFolder(string $folder): ResponseCollection;
168+
public function select(string $folder): ResponseCollection;
102169

103170
/**
171+
* Send a "EXAMINE" command.
172+
*
104173
* Examine a given folder.
174+
*
175+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-examine-command
105176
*/
106-
public function examineFolder(string $folder): ResponseCollection;
177+
public function examine(string $folder): ResponseCollection;
107178

108179
/**
180+
* Send a "LIST" command.
181+
*
109182
* Get a list of available folders.
183+
*
184+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-list-command
110185
*/
111-
public function folders(string $reference = '', string $folder = '*'): ResponseCollection;
186+
public function list(string $reference = '', string $folder = '*'): ResponseCollection;
112187

113188
/**
189+
* Send a "STATUS" command.
190+
*
114191
* Get the status of a given folder.
192+
*
193+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-status-command
115194
*/
116-
public function folderStatus(string $folder, array $arguments = ['MESSAGES', 'UNSEEN', 'RECENT', 'UIDNEXT', 'UIDVALIDITY']): UntaggedResponse;
195+
public function status(string $folder, array $arguments = ['MESSAGES', 'UNSEEN', 'RECENT', 'UIDNEXT', 'UIDVALIDITY']): UntaggedResponse;
117196

118197
/**
198+
* Send a "STORE" command.
199+
*
119200
* Set message flags.
201+
*
202+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-store-command
120203
*/
121204
public function store(array|string $flags, int $from, ?int $to = null, ?string $mode = null, bool $silent = true, ?string $item = null): ResponseCollection;
122205

123206
/**
207+
* Send a "APPEND" command.
208+
*
124209
* Append a new message to given folder.
210+
*
211+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-append-command
125212
*/
126-
public function appendMessage(string $folder, string $message, ?array $flags = null, ?string $date = null): ResponseCollection;
213+
public function append(string $folder, string $message, ?array $flags = null, ?string $date = null): ResponseCollection;
127214

128215
/**
216+
* Send a "UID COPY" command.
217+
*
129218
* Copy message set from current folder to other folder.
219+
*
220+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-copy-command
130221
*/
131-
public function copyMessage(string $folder, $from, ?int $to = null): void;
132-
133-
/**
134-
* Copy multiple messages to the target folder.
135-
*/
136-
public function copyManyMessages(array $messages, string $folder): void;
222+
public function copy(string $folder, array|int $from, ?int $to = null): void;
137223

138224
/**
225+
* Send a "UID MOVE" command.
226+
*
139227
* Move a message set from current folder to another folder.
228+
*
229+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-move-command
140230
*/
141-
public function moveMessage(string $folder, $from, ?int $to = null): void;
142-
143-
/**
144-
* Move multiple messages to the target folder.
145-
*/
146-
public function moveManyMessages(array $messages, string $folder): void;
231+
public function move(string $folder, array|int $from, ?int $to = null): void;
147232

148233
/**
234+
* Send a "CREATE" command.
235+
*
149236
* Create a new folder.
237+
*
238+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-create-command
150239
*/
151-
public function createFolder(string $folder): ResponseCollection;
240+
public function create(string $folder): ResponseCollection;
152241

153242
/**
243+
* Send a "DELETE" command.
244+
*
154245
* Delete a folder.
246+
*
247+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-delete-command
155248
*/
156-
public function deleteFolder(string $folder): TaggedResponse;
249+
public function delete(string $folder): TaggedResponse;
157250

158251
/**
159-
* Subscribe to a folder.
252+
* Send a "RENAME" command.
253+
*
254+
* Rename an existing folder.
255+
*
256+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-rename-command
160257
*/
161-
public function subscribeFolder(string $folder): TaggedResponse;
258+
public function rename(string $oldPath, string $newPath): TaggedResponse;
162259

163260
/**
164-
* Unsubscribe from a folder.
261+
* Send a "SUBSCRIBE" command.
262+
*
263+
* Subscribe to a folder.
264+
*
265+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-subscribe-command
165266
*/
166-
public function unsubscribeFolder(string $folder): TaggedResponse;
267+
public function subscribe(string $folder): TaggedResponse;
167268

168269
/**
169-
* Rename an existing folder.
270+
* Send a "UNSUBSCRIBE" command.
271+
*
272+
* Unsubscribe from a folder.
273+
*
274+
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-unsubscribe-command
170275
*/
171-
public function renameFolder(string $oldPath, string $newPath): TaggedResponse;
276+
public function unsubscribe(string $folder): TaggedResponse;
172277
}

0 commit comments

Comments
 (0)