Skip to content

Commit a43bc33

Browse files
committed
Annotate function aliases in stubs
1 parent fc5a88f commit a43bc33

16 files changed

+133
-30
lines changed

build/gen_stub.php

100644100755
File mode changed.

ext/bz2/bz2.stub.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@ function bzopen($file, string $mode) {}
99
/** @param resource $bz */
1010
function bzread($bz, int $length = 1024): string|false {}
1111

12-
/** @param resource $bz */
12+
/**
13+
* @param resource $bz
14+
* @alias fwrite
15+
*/
1316
function bzwrite($bz, string $str, int $length = UNKNOWN): int|false {}
1417

15-
/** @param resource $bz */
18+
/**
19+
* @param resource $bz
20+
* @alias fflush
21+
*/
1622
function bzflush($bz): bool {}
1723

18-
/** @param resource $bz */
24+
/**
25+
* @param resource $bz
26+
* @alias fclose
27+
*/
1928
function bzclose($bz): bool {}
2029

2130
/** @param resource $bz */

ext/ftp/ftp.stub.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ function ftp_site($ftp, string $cmd): bool {}
113113
/** @param resource $ftp */
114114
function ftp_close($ftp): bool {}
115115

116-
/** @param resource $ftp */
116+
/**
117+
* @param resource $ftp
118+
* @alias ftp_close
119+
*/
117120
function ftp_quit($ftp): bool {}
118121

119122
/** @param resource $ftp */

ext/gmp/gmp.stub.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ function gmp_div_r($a, $b, int $round = GMP_ROUND_ZERO): GMP|false {}
5353
/**
5454
* @param GMP|int|bool|string $a
5555
* @param GMP|int|bool|string $b
56+
* @alias gmp_div_q
5657
*/
5758
function gmp_div($a, $b, int $round = GMP_ROUND_ZERO): GMP|false {}
5859

ext/imap/php_imap.stub.php

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ 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+
/** @alias imap_headerinfo */
3031
function imap_header($stream_id, int $msg_no, int $from_length = 0, int $subject_length = 0, string $default_host = UNKNOWN): stdClass|false {}
3132

3233
function imap_rfc822_parse_headers(string $headers, string $default_host = 'UNKNOWN'): \stdClass {}
@@ -38,7 +39,10 @@ function imap_rfc822_parse_adrlist(string $address_string, string $default_host)
3839
/** @param resource $stream_id */
3940
function imap_body($stream_id, int $msg_no, int $options = 0): string|false {}
4041

41-
/** @param resource $stream_id */
42+
/**
43+
* @param resource $stream_id
44+
* @alias imap_body
45+
*/
4246
function imap_fetchtext($stream_id, int $msg_no, int $options = 0): string|false {}
4347

4448
/**
@@ -91,10 +95,16 @@ function imap_check($stream_id): stdClass|false {}
9195
/** @param resource $stream_id */
9296
function imap_listscan($stream_id, string $ref, string $pattern, string $content): array|false {}
9397

94-
/** @param resource $stream_id */
98+
/**
99+
* @param resource $stream_id
100+
* @alias imap_listscan
101+
*/
95102
function imap_scan($stream_id, string $ref, string $pattern, string $content): array|false {}
96103

97-
/** @param resource $stream_id */
104+
/**
105+
* @param resource $stream_id
106+
* @alias imap_listscan
107+
*/
98108
function imap_scanmailbox($stream_id, string $ref, string $pattern, string $content): array|false {}
99109

100110
/** @param resource $stream_id */
@@ -108,13 +118,19 @@ function imap_mail_compose(array $envelope, array $body): string|false {}
108118
/** @param resource $stream_id */
109119
function imap_createmailbox($stream_id, string $mailbox): bool {}
110120

111-
/** @param resource $stream_id */
121+
/**
122+
* @param resource $stream_id
123+
* @alias imap_createmailbox
124+
*/
112125
function imap_create($stream_id, string $mailbox): bool {}
113126

114127
/** @param resource $stream_id */
115128
function imap_renamemailbox($stream_id, string $old_name, string $new_name): bool {}
116129

117-
/** @param resource $stream_id */
130+
/**
131+
* @param resource $stream_id
132+
* @alias imap_renamemailbox
133+
*/
118134
function imap_rename($stream_id, string $old_name, string $new_name): bool {}
119135

120136
/** @param resource $stream_id */
@@ -170,13 +186,19 @@ function imap_msgno($stream_id, int $unique_msg_id): int|false {}
170186
/** @param resource $stream_id */
171187
function imap_list($stream_id, string $ref, string $pattern): array|false {}
172188

173-
/** @param resource $stream_id */
189+
/**
190+
* @param resource $stream_id
191+
* @alias imap_list
192+
*/
174193
function imap_listmailbox($stream_id, string $ref, string $pattern): array|false {}
175194

176195
/** @param resource $stream_id */
177196
function imap_lsub($stream_id, string $ref, string $pattern): array|false {}
178197

179-
/** @param resource $stream_id */
198+
/**
199+
* @param resource $stream_id
200+
* @alias imap_lsub
201+
*/
180202
function imap_listsubscribed($stream_id, string $ref, string $pattern): array|false {}
181203

182204
/** @param resource $stream_id */

ext/ldap/ldap.stub.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ function ldap_connect(string $hostname = UNKNOWN, int $port = 389) {}
1313
/** @param resource $link_identifier */
1414
function ldap_unbind($link_identifier): bool {}
1515

16-
/** @param resource $link_identifier */
16+
/**
17+
* @param resource $link_identifier
18+
* @alias ldap_unbind
19+
*/
1720
function ldap_close($link_identifier): bool {}
1821

1922
/** @param resource $link_identifier */
@@ -111,6 +114,7 @@ function ldap_get_values_len($link_identifier, $result_entry_identifier, string
111114
/**
112115
* @param resource $link_identifier
113116
* @param resource $result_entry_identifier
117+
* @alias ldap_get_values_len
114118
*/
115119
function ldap_get_values($link_identifier, $result_entry_identifier, string $attribute): array|false {}
116120

@@ -157,7 +161,10 @@ function ldap_mod_add_ext($link_identifier, string $dn, array $entry, array $ser
157161
/** @param resource $link_identifier */
158162
function ldap_mod_replace($link_identifier, string $dn, array $entry, array $servercontrols = []): bool {}
159163

160-
/** @param resource $link_identifier */
164+
/**
165+
* @param resource $link_identifier
166+
* @alias ldap_mod_replace
167+
*/
161168
function ldap_modify($link_identifier, string $dn, array $entry, array $servercontrols = []): bool {}
162169

163170
/**

ext/mysqli/mysqli.stub.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ function mysqli_error_list(mysqli $mysql_link): array {}
321321

322322
function mysqli_stmt_execute(mysqli_stmt $mysql_stmt): bool {}
323323

324+
/** @alias mysqli_stmt_execute */
324325
function mysqli_execute(mysqli_stmt $mysql_stmt): bool {}
325326

326327
function mysqli_fetch_field(mysqli_result $mysql_result): object|false {}
@@ -513,7 +514,11 @@ function mysqli_warning_count(mysqli $mysql_link): int {}
513514

514515
function mysqli_refresh(mysqli $mysqli_link, int $options): bool {}
515516

517+
/** @alias mysqli_real_escape_string */
516518
function mysqli_escape_string(mysqli $mysqli_link, string $string_to_escape): string {}
517519

518-
/** @param mixed $value */
520+
/**
521+
* @param mixed $value
522+
* @alias mysqli_options
523+
*/
519524
function mysqli_set_opt(mysqli $mysqli_link, int $option, $value): bool {}

ext/odbc/odbc.stub.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ function odbc_exec($connection_id, string $query, int $flags = UNKNOWN) {}
3434
/**
3535
* @param resource $connection_id
3636
* @return resource|false
37+
* @alias odbc_exec
3738
*/
3839
function odbc_do($connection_id, string $query, int $flags = UNKNOWN) {}
3940

@@ -92,7 +93,10 @@ function odbc_field_type($result_id, int $field_number): string|false {}
9293
/** @param resource $result_id */
9394
function odbc_field_len($result_id, int $field_number): int|false {}
9495

95-
/** @param resource $result_id */
96+
/**
97+
* @param resource $result_id
98+
* @alias odbc_field_len
99+
*/
96100
function odbc_field_precision($result_id, int $field_number): int|false {}
97101

98102
/** @param resource $result_id */

ext/openssl/openssl.stub.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,17 @@ function openssl_pkey_get_public($cert) {}
7777
/**
7878
* @param resource|string|array $cert
7979
* @return resource|false
80+
* @alias openssl_pkey_get_public
8081
*/
8182
function openssl_get_publickey($cert) {}
8283

8384
/** @param resource $key */
8485
function openssl_pkey_free($key): void {}
8586

86-
/** @param resource $key */
87+
/**
88+
* @param resource $key
89+
* @alias openssl_pkey_free
90+
*/
8791
function openssl_free_key($key): void {}
8892

8993
/**
@@ -95,6 +99,7 @@ function openssl_pkey_get_private($key, string $passphrase = UNKNOWN) {}
9599
/**
96100
* @param resource|string|array $key
97101
* @return resource|false
102+
* @alias openssl_pkey_get_private
98103
*/
99104
function openssl_get_privatekey($key, string $passphrase = UNKNOWN) {}
100105

ext/pcntl/pcntl.stub.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ function pcntl_alarm(int $seconds): int {}
5050

5151
function pcntl_get_last_error(): int {}
5252

53+
/** @alias pcntl_get_last_error */
5354
function pcntl_errno(): int {}
5455

5556
#ifdef HAVE_GETPRIORITY

ext/posix/posix.stub.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ function posix_setrlimit(int $resource, int $softlimit, int $hardlimit): bool {}
9393

9494
function posix_get_last_error(): int {}
9595

96+
/** @alias posix_get_last_error */
9697
function posix_errno(): int {}
9798

9899
function posix_strerror(int $errno): string {}

ext/session/session.stub.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ function session_status(): int {}
3434

3535
function session_register_shutdown(): void {}
3636

37+
/** @alias session_write_close */
3738
function session_commit(): bool {}
3839

3940
function session_set_save_handler($open, $close = null, $read = null, $write = null, $destroy = null, $gc = null, $create_sid = null, $validate_sid = null, $update_timestamp = null): bool {}

ext/snmp/snmp.stub.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ function snmpwalk(string $host, string $community, $object_id, int $timeout = UN
1212
/** @param array|string $object_id */
1313
function snmprealwalk(string $host, string $community, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN): array|bool {}
1414

15-
/** @param array|string $object_id */
15+
/**
16+
* @param array|string $object_id
17+
* @alias snmprealwalk
18+
*/
1619
function snmpwalkoid(string $host, string $community, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN): array|bool {}
1720

1821
/**
@@ -30,6 +33,7 @@ function snmp_set_enum_print(int $enum_print): bool {}
3033

3134
function snmp_set_oid_output_format(int $oid_format): bool {}
3235

36+
/** @alias snmp_set_oid_output_format */
3337
function snmp_set_oid_numeric_print(int $oid_format): bool {}
3438

3539
/** @param array|string $object_id */

ext/sockets/sockets.stub.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,19 @@ function socket_sendto($socket, string $buf, int $len, int $flags, string $addr,
6161
/** @param resource $socket */
6262
function socket_get_option($socket, int $level, int $optname): array|int|false {}
6363

64-
/** @param resource $socket */
64+
/**
65+
* @param resource $socket
66+
* @alias socket_get_option
67+
*/
6568
function socket_getopt($socket, int $level, int $optname): array|int|false {}
6669

6770
/** @param resource $socket */
6871
function socket_set_option($socket, int $level, int $optname, $optval): bool {}
6972

70-
/** @param resource $socket */
73+
/**
74+
* @param resource $socket
75+
* @alias socket_set_option
76+
*/
7177
function socket_setopt($socket, int $level, int $optname, $optval): bool {}
7278

7379
#ifdef HAVE_SOCKETPAIR

ext/sodium/libsodium.stub.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,5 @@ function sodium_bin2base64(string $string, int $id): string {}
182182
function sodium_base642bin(string $string, int $id, string $ignore = ""): string {}
183183
#endif
184184

185+
/** @alias sodium_crypto_box_publickey_from_secretkey */
185186
function sodium_crypto_scalarmult_base(string $key): string {}

ext/zlib/zlib.stub.php

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,37 +27,70 @@ function gzdecode(string $data, int $max_decoded_len = 0): string|false {}
2727

2828
function gzuncompress(string $data, int $max_decoded_len = 0): string|false {}
2929

30-
/** @param resource $fp */
30+
/**
31+
* @param resource $fp
32+
* @alias fwrite
33+
*/
3134
function gzwrite($fp, string $str, int $length = UNKNOWN): int|false {}
3235

33-
/** @param resource $fp */
36+
/**
37+
* @param resource $fp
38+
* @alias fwrite
39+
*/
3440
function gzputs($fp, string $str, int $length = UNKNOWN): int|false {}
3541

36-
/** @param resource $fp */
42+
/**
43+
* @param resource $fp
44+
* @alias rewind
45+
*/
3746
function gzrewind($fp): bool {}
3847

39-
/** @param resource $fp */
48+
/**
49+
* @param resource $fp
50+
* @alias fclose
51+
*/
4052
function gzclose($fp): bool {}
4153

42-
/** @param resource $fp */
54+
/**
55+
* @param resource $fp
56+
* @alias feof
57+
*/
4358
function gzeof($fp): bool {}
4459

45-
/** @param resource $fp */
60+
/**
61+
* @param resource $fp
62+
* @alias fgetc
63+
*/
4664
function gzgetc($fp): string|false {}
4765

48-
/** @param resource $fp */
66+
/**
67+
* @param resource $fp
68+
* @alias fpassthru
69+
*/
4970
function gzpassthru($fp): int {}
5071

51-
/** @param resource $fp */
72+
/**
73+
* @param resource $fp
74+
* @alias fseek
75+
*/
5276
function gzseek($fp, int $offset, int $whence = SEEK_SET): int {}
5377

54-
/** @param resource $fp */
78+
/**
79+
* @param resource $fp
80+
* @alias ftell
81+
*/
5582
function gztell($fp): int|false {}
5683

57-
/** @param resource $fp */
84+
/**
85+
* @param resource $fp
86+
* @alias fread
87+
*/
5888
function gzread($fp, int $length): string|false {}
5989

60-
/** @param resource $fp */
90+
/**
91+
* @param resource $fp
92+
* @alias fgets
93+
*/
6194
function gzgets($fp, int $length = 1024): string|false {}
6295

6396
/** @return resource|false */

0 commit comments

Comments
 (0)