Skip to content

Commit 736b22d

Browse files
committed
Add stubs for aliases
Closes GH-5187
1 parent 172010a commit 736b22d

25 files changed

+295
-164
lines changed

ext/bz2/bz2.stub.php

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,19 @@ function bzread($bz, int $length = 1024): string|false {}
1212
/** @param resource $bz */
1313
function bzwrite($bz, string $str, int $length = UNKNOWN): int|false {}
1414

15-
/**
16-
* @param resource $bz
17-
*/
15+
/** @param resource $bz */
1816
function bzflush($bz): bool {}
1917

20-
/**
21-
* @param resource $bz
22-
*/
18+
/** @param resource $bz */
2319
function bzclose($bz): bool {}
2420

25-
/**
26-
* @param resource $bz
27-
*/
21+
/** @param resource $bz */
2822
function bzerrno($bz): int {}
2923

30-
/**
31-
* @param resource $bz
32-
*/
24+
/** @param resource $bz */
3325
function bzerrstr($bz): string {}
3426

35-
/**
36-
* @param resource $bz
37-
*/
27+
/** @param resource $bz */
3828
function bzerror($bz): array {}
3929

4030
function bzcompress(string $source, int $blocksize = 4, int $workfactor = 0): string|int {}

ext/ftp/ftp.stub.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ function ftp_site($ftp, string $cmd): bool {}
113113
/** @param resource $ftp */
114114
function ftp_close($ftp): bool {}
115115

116+
/** @param resource $ftp */
117+
function ftp_quit($ftp): bool {}
118+
116119
/** @param resource $ftp */
117120
function ftp_set_option($ftp, int $option, $value): bool {}
118121

ext/ftp/ftp_arginfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ ZEND_END_ARG_INFO()
182182

183183
#define arginfo_ftp_close arginfo_ftp_cdup
184184

185+
#define arginfo_ftp_quit arginfo_ftp_cdup
186+
185187
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_set_option, 0, 3, _IS_BOOL, 0)
186188
ZEND_ARG_INFO(0, ftp)
187189
ZEND_ARG_TYPE_INFO(0, option, IS_LONG, 0)

ext/ftp/php_ftp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static const zend_function_entry php_ftp_functions[] = {
7575
PHP_FE(ftp_nb_continue, arginfo_ftp_nb_continue)
7676
PHP_FE(ftp_nb_put, arginfo_ftp_nb_put)
7777
PHP_FE(ftp_nb_fput, arginfo_ftp_nb_fput)
78-
PHP_FALIAS(ftp_quit, ftp_close, arginfo_ftp_close)
78+
PHP_FALIAS(ftp_quit, ftp_close, arginfo_ftp_quit)
7979
PHP_FE_END
8080
};
8181

ext/imap/php_imap.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,14 @@ static const zend_function_entry imap_functions[] = {
174174
PHP_FE(imap_getsubscribed, arginfo_imap_getsubscribed)
175175
PHP_FE(imap_getmailboxes, arginfo_imap_getmailboxes)
176176

177-
PHP_FALIAS(imap_header, imap_headerinfo, arginfo_imap_headerinfo)
178-
PHP_FALIAS(imap_listmailbox, imap_list, arginfo_imap_list)
179-
PHP_FALIAS(imap_scanmailbox, imap_listscan, arginfo_imap_listscan)
180-
PHP_FALIAS(imap_listsubscribed, imap_lsub, arginfo_imap_lsub)
181-
PHP_FALIAS(imap_fetchtext, imap_body, arginfo_imap_body)
182-
PHP_FALIAS(imap_scan, imap_listscan, arginfo_imap_listscan)
183-
PHP_FALIAS(imap_create, imap_createmailbox, arginfo_imap_createmailbox)
184-
PHP_FALIAS(imap_rename, imap_renamemailbox, arginfo_imap_renamemailbox)
177+
PHP_FALIAS(imap_header, imap_headerinfo, arginfo_imap_header)
178+
PHP_FALIAS(imap_listmailbox, imap_list, arginfo_imap_listmailbox)
179+
PHP_FALIAS(imap_scanmailbox, imap_listscan, arginfo_imap_scanmailbox)
180+
PHP_FALIAS(imap_listsubscribed, imap_lsub, arginfo_imap_listsubscribed)
181+
PHP_FALIAS(imap_fetchtext, imap_body, arginfo_imap_fetchtext)
182+
PHP_FALIAS(imap_scan, imap_listscan, arginfo_imap_scan)
183+
PHP_FALIAS(imap_create, imap_createmailbox, arginfo_imap_create)
184+
PHP_FALIAS(imap_rename, imap_renamemailbox, arginfo_imap_rename)
185185
PHP_FE_END
186186
};
187187
/* }}} */

ext/imap/php_imap.stub.php

Lines changed: 37 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ function imap_headers($stream_id): array|false {}
2727
/** @param resource $stream_id */
2828
function imap_headerinfo($stream_id, int $msg_no, int $from_length = 0, int $subject_length = 0, string $default_host = UNKNOWN): stdClass|false {}
2929

30+
function imap_header($stream_id, int $msg_no, int $from_length = 0, int $subject_length = 0, string $default_host = UNKNOWN): stdClass|false {}
31+
3032
function imap_rfc822_parse_headers(string $headers, string $default_host = 'UNKNOWN'): \stdClass {}
3133

3234
function imap_rfc822_write_address(string $mailbox, string $host, string $personal): string|false {}
@@ -36,6 +38,9 @@ function imap_rfc822_parse_adrlist(string $address_string, string $default_host)
3638
/** @param resource $stream_id */
3739
function imap_body($stream_id, int $msg_no, int $options = 0): string|false {}
3840

41+
/** @param resource $stream_id */
42+
function imap_fetchtext($stream_id, int $msg_no, int $options = 0): string|false {}
43+
3944
/**
4045
* @param resource $stream_id
4146
* @return \stdClass|false
@@ -86,51 +91,45 @@ function imap_check($stream_id): stdClass|false {}
8691
/** @param resource $stream_id */
8792
function imap_listscan($stream_id, string $ref, string $pattern, string $content): array|false {}
8893

89-
/**
90-
* @param resource $stream_id
91-
*/
94+
/** @param resource $stream_id */
95+
function imap_scan($stream_id, string $ref, string $pattern, string $content): array|false {}
96+
97+
/** @param resource $stream_id */
98+
function imap_scanmailbox($stream_id, string $ref, string $pattern, string $content): array|false {}
99+
100+
/** @param resource $stream_id */
92101
function imap_mail_copy($stream_id, string $msglist, string $mailbox, int $options = 0): bool {}
93102

94-
/**
95-
* @param resource $stream_id
96-
*/
103+
/** @param resource $stream_id */
97104
function imap_mail_move($stream_id, string $sequence, string $mailbox, int $options = 0): bool {}
98105

99106
function imap_mail_compose(array $envelope, array $body): string|false {}
100107

101-
/**
102-
* @param resource $stream_id
103-
*/
108+
/** @param resource $stream_id */
104109
function imap_createmailbox($stream_id, string $mailbox): bool {}
105110

106-
/**
107-
* @param resource $stream_id
108-
*/
111+
/** @param resource $stream_id */
112+
function imap_create($stream_id, string $mailbox): bool {}
113+
114+
/** @param resource $stream_id */
109115
function imap_renamemailbox($stream_id, string $old_name, string $new_name): bool {}
110116

111-
/**
112-
* @param resource $stream_id
113-
*/
117+
/** @param resource $stream_id */
118+
function imap_rename($stream_id, string $old_name, string $new_name): bool {}
119+
120+
/** @param resource $stream_id */
114121
function imap_deletemailbox($stream_id, string $mailbox): bool {}
115122

116-
/**
117-
* @param resource $stream_id
118-
*/
123+
/** @param resource $stream_id */
119124
function imap_subscribe($stream_id, string $mailbox): bool {}
120125

121-
/**
122-
* @param resource $stream_id
123-
*/
126+
/** @param resource $stream_id */
124127
function imap_unsubscribe($stream_id, string $mailbox): bool {}
125128

126-
/**
127-
* @param resource $stream_id
128-
*/
129+
/** @param resource $stream_id */
129130
function imap_append($stream_id, string $folder, string $message, string $options = UNKNOWN, string $internal_date = UNKNOWN): bool {}
130131

131-
/**
132-
* @param resource $stream_id
133-
*/
132+
/** @param resource $stream_id */
134133
function imap_ping($stream_id): bool {}
135134

136135
function imap_base64(string $text): string|false {}
@@ -150,25 +149,18 @@ function imap_utf8(string $mime_encoded_text): string {}
150149
*/
151150
function imap_status($stream_id, string $mailbox, int $options) {}
152151

153-
/**
154-
* @param resource $stream_id
155-
*/
152+
/** @param resource $stream_id */
156153
function imap_mailboxmsginfo($stream_id): \stdClass {}
157154

158-
/**
159-
* @param resource $stream_id
160-
*/
155+
/** @param resource $stream_id */
161156
function imap_setflag_full($stream_id, string $sequence, string $flag, int $options = 0): bool {}
162157

163-
/**
164-
* @param resource $stream_id
165-
*/
158+
/** @param resource $stream_id */
166159
function imap_clearflag_full($stream_id, string $sequence, string $flag, int $options = 0): bool {}
167160

168161
/** @param resource $stream_id */
169162
function imap_sort($stream_id, int $criteria, int $reverse, int $options = 0, string $search_criteria = UNKNOWN, string $charset = UNKNOWN): array|false {}
170163

171-
172164
/** @param resource $stream_id */
173165
function imap_uid($stream_id, int $msg_no): int|false {}
174166

@@ -178,9 +170,15 @@ function imap_msgno($stream_id, int $unique_msg_id): int|false {}
178170
/** @param resource $stream_id */
179171
function imap_list($stream_id, string $ref, string $pattern): array|false {}
180172

173+
/** @param resource $stream_id */
174+
function imap_listmailbox($stream_id, string $ref, string $pattern): array|false {}
175+
181176
/** @param resource $stream_id */
182177
function imap_lsub($stream_id, string $ref, string $pattern): array|false {}
183178

179+
/** @param resource $stream_id */
180+
function imap_listsubscribed($stream_id, string $ref, string $pattern): array|false {}
181+
184182
/** @param resource $stream_id */
185183
function imap_getsubscribed($stream_id, string $ref, string $pattern): array|false {}
186184

@@ -223,14 +221,10 @@ function imap_get_quota($stream_id, string $qroot): array|false {}
223221
/** @param resource $stream_id */
224222
function imap_get_quotaroot($stream_id, string $mbox): array|false {}
225223

226-
/**
227-
* @param resource $stream_id
228-
*/
224+
/** @param resource $stream_id */
229225
function imap_set_quota($stream_id, string $qroot, int $mailbox_size): bool {}
230226

231-
/**
232-
* @param resource $stream_id
233-
*/
227+
/** @param resource $stream_id */
234228
function imap_setacl($stream_id, string $mailbox, string $id, string $rights): bool {}
235229

236230
/** @param resource $stream_id */

ext/imap/php_imap_arginfo.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imap_headerinfo, 0, 2, stdCl
3939
ZEND_ARG_TYPE_INFO(0, default_host, IS_STRING, 0)
4040
ZEND_END_ARG_INFO()
4141

42+
#define arginfo_imap_header arginfo_imap_headerinfo
43+
4244
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_imap_rfc822_parse_headers, 0, 1, stdClass, 0)
4345
ZEND_ARG_TYPE_INFO(0, headers, IS_STRING, 0)
4446
ZEND_ARG_TYPE_INFO(0, default_host, IS_STRING, 0)
@@ -61,6 +63,8 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_body, 0, 2, MAY_BE_STRING|M
6163
ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0)
6264
ZEND_END_ARG_INFO()
6365

66+
#define arginfo_imap_fetchtext arginfo_imap_body
67+
6468
ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_bodystruct, 0, 0, 3)
6569
ZEND_ARG_INFO(0, stream_id)
6670
ZEND_ARG_TYPE_INFO(0, msg_no, IS_LONG, 0)
@@ -120,6 +124,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_listscan, 0, 4, MAY_BE_ARRA
120124
ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0)
121125
ZEND_END_ARG_INFO()
122126

127+
#define arginfo_imap_scan arginfo_imap_listscan
128+
129+
#define arginfo_imap_scanmailbox arginfo_imap_listscan
130+
123131
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_mail_copy, 0, 3, _IS_BOOL, 0)
124132
ZEND_ARG_INFO(0, stream_id)
125133
ZEND_ARG_TYPE_INFO(0, msglist, IS_STRING, 0)
@@ -144,12 +152,16 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_createmailbox, 0, 2, _IS_BO
144152
ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0)
145153
ZEND_END_ARG_INFO()
146154

155+
#define arginfo_imap_create arginfo_imap_createmailbox
156+
147157
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_renamemailbox, 0, 3, _IS_BOOL, 0)
148158
ZEND_ARG_INFO(0, stream_id)
149159
ZEND_ARG_TYPE_INFO(0, old_name, IS_STRING, 0)
150160
ZEND_ARG_TYPE_INFO(0, new_name, IS_STRING, 0)
151161
ZEND_END_ARG_INFO()
152162

163+
#define arginfo_imap_rename arginfo_imap_renamemailbox
164+
153165
#define arginfo_imap_deletemailbox arginfo_imap_createmailbox
154166

155167
#define arginfo_imap_subscribe arginfo_imap_createmailbox
@@ -224,8 +236,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_list, 0, 3, MAY_BE_ARRAY|MA
224236
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
225237
ZEND_END_ARG_INFO()
226238

239+
#define arginfo_imap_listmailbox arginfo_imap_list
240+
227241
#define arginfo_imap_lsub arginfo_imap_list
228242

243+
#define arginfo_imap_listsubscribed arginfo_imap_list
244+
229245
#define arginfo_imap_getsubscribed arginfo_imap_list
230246

231247
#define arginfo_imap_getmailboxes arginfo_imap_list

0 commit comments

Comments
 (0)