Skip to content

Commit 79981a3

Browse files
committed
Add a bunch of missing argument types to stubs
1 parent 6ba24e9 commit 79981a3

20 files changed

+93
-34
lines changed

ext/dba/dba.stub.php

+14-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,22 @@
22

33
/** @generate-function-entries */
44

5-
/** @return resource|false */
5+
/**
6+
* @param string $path
7+
* @param string $mode
8+
* @param string $handlername
9+
* @param string $handler_parameters
10+
* @return resource|false
11+
*/
612
function dba_popen($path, $mode, $handlername = UNKNOWN, ...$handler_parameters) {}
713

8-
/** @return resource|false */
14+
/**
15+
* @param string $path
16+
* @param string $mode
17+
* @param string $handlername
18+
* @param string $handler_parameters
19+
* @return resource|false
20+
*/
921
function dba_open($path, $mode, $handlername = UNKNOWN, ...$handler_parameters) {}
1022

1123
/** @param resource $handle */

ext/dba/dba_arginfo.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 3f28cb0c990d15e6d2f34c40c2f0219b11d2d5e4 */
2+
* Stub hash: 5b43c7cfcb48f3081d5585192eaaa5185df036f8 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_dba_popen, 0, 0, 2)
55
ZEND_ARG_INFO(0, path)

ext/ftp/ftp.stub.php

+9-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ function ftp_rmdir($ftp, string $directory): bool {}
3737
/** @param resource $ftp */
3838
function ftp_chmod($ftp, int $mode, string $filename): int|false {}
3939

40-
/** @param resource $ftp */
40+
/**
41+
* @param resource $ftp
42+
* @param string $response
43+
*/
4144
function ftp_alloc($ftp, int $size, &$response = null): bool {}
4245

4346
/** @param resource $ftp */
@@ -86,7 +89,7 @@ function ftp_fput($ftp, string $remote_file, $fp, int $mode = FTP_BINARY, int $s
8689
* @param resource $ftp
8790
* @param resource $fp
8891
*/
89-
function ftp_nb_fput($ftp, string $remote_file, $fp, $mode = FTP_BINARY, $startpos = 0): int|false {}
92+
function ftp_nb_fput($ftp, string $remote_file, $fp, int $mode = FTP_BINARY, int $startpos = 0): int|false {}
9093

9194
/** @param resource $ftp */
9295
function ftp_put($ftp, string $remote_file, string $local_file, int $mode = FTP_BINARY, int $startpos = 0): bool {}
@@ -121,7 +124,10 @@ function ftp_close($ftp): bool {}
121124
*/
122125
function ftp_quit($ftp): bool {}
123126

124-
/** @param resource $ftp */
127+
/**
128+
* @param resource $ftp
129+
* @param int|bool $value
130+
*/
125131
function ftp_set_option($ftp, int $option, $value): bool {}
126132

127133
/** @param resource $ftp */

ext/ftp/ftp_arginfo.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 0bbaf1b0aed026d0ed32274bc1084b363528bb61 */
2+
* Stub hash: 830fdf6caf2804d49739fc5112c7091c0f6eb4d4 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_connect, 0, 0, 1)
55
ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0)
@@ -131,8 +131,8 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ftp_nb_fput, 0, 3, MAY_BE_LONG|M
131131
ZEND_ARG_INFO(0, ftp)
132132
ZEND_ARG_TYPE_INFO(0, remote_file, IS_STRING, 0)
133133
ZEND_ARG_INFO(0, fp)
134-
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, mode, "FTP_BINARY")
135-
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, startpos, "0")
134+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "FTP_BINARY")
135+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, startpos, IS_LONG, 0, "0")
136136
ZEND_END_ARG_INFO()
137137

138138
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_put, 0, 3, _IS_BOOL, 0)

ext/imap/php_imap.stub.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ function imap_headers($stream_id): array|false {}
2929
/** @param resource $stream_id */
3030
function imap_headerinfo($stream_id, int $msg_no, int $from_length = 0, int $subject_length = 0, string $default_host = UNKNOWN): stdClass|false {}
3131

32-
/** @alias imap_headerinfo */
32+
/**
33+
* @param resource $stream_id
34+
* @alias imap_headerinfo
35+
*/
3336
function imap_header($stream_id, int $msg_no, int $from_length = 0, int $subject_length = 0, string $default_host = UNKNOWN): stdClass|false {}
3437

3538
function imap_rfc822_parse_headers(string $headers, string $default_host = 'UNKNOWN'): \stdClass {}
@@ -61,7 +64,7 @@ function imap_fetchmime($stream_id, int $msg_no, string $section, int $options =
6164

6265
/**
6366
* @param resource $stream_id
64-
* @todo: should $file be `resource|string`? it looks like it tries to accept anything?
67+
* @param resource|string|int $file
6568
*/
6669
function imap_savebody($stream_id, $file, int $msg_no, string $section = '', int $options = 0): bool {}
6770

ext/imap/php_imap_arginfo.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 1105c40befb73bbc51cc9438d53404801338a15c */
2+
* Stub hash: 449bab2357a8a83cbe4f630a87776ebb5e0d65f6 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_open, 0, 0, 3)
55
ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0)

ext/intl/php_intl.stub.php

+11-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function intlcal_after(IntlCalendar $calendarObject, IntlCalendar $calendar): bo
2828

2929
function intlcal_before(IntlCalendar $calendarObject, IntlCalendar $calendar): bool {}
3030

31-
function intlcal_set(IntlCalendar $calendar, int $year, int $month, int $dayOfMonth = UNKNOWN, $hour = UNKNOWN, int $minute = UNKNOWN, int $second = UNKNOWN): bool {}
31+
function intlcal_set(IntlCalendar $calendar, int $year, int $month, int $dayOfMonth = UNKNOWN, int $hour = UNKNOWN, int $minute = UNKNOWN, int $second = UNKNOWN): bool {}
3232

3333
/** @param int|bool $amountOrUpOrDown */
3434
function intlcal_roll(IntlCalendar $calendar, int $field, $amountOrUpOrDown): bool {}
@@ -190,8 +190,10 @@ function datefmt_format(IntlDateFormatter $df, $value): string|false {}
190190
*/
191191
function datefmt_format_object($object, $format = null, ?string $locale = null): string|false {}
192192

193+
/** @param int $position */
193194
function datefmt_parse(IntlDateFormatter $df, string $value, &$position = null): int|float|false {}
194195

196+
/** @param int $position */
195197
function datefmt_localtime(IntlDateFormatter $df, string $value, &$position = null): array|false {}
196198

197199
function datefmt_get_error_code(IntlDateFormatter $df): int {}
@@ -204,10 +206,15 @@ function numfmt_create(string $locale, int $style, string $pattern = ""): ?Numbe
204206

205207
function numfmt_format(NumberFormatter $fmt, int|float $value, int $type = NumberFormatter::TYPE_DEFAULT): string|false {}
206208

209+
/** @param int $position */
207210
function numfmt_parse(NumberFormatter $fmt, string $value, int $type = NumberFormatter::TYPE_DOUBLE, &$position = null): int|float|false {}
208211

209212
function numfmt_format_currency(NumberFormatter $fmt, float $value, string $currency): string|false {}
210213

214+
/**
215+
* @param string $currency
216+
* @param int $position
217+
*/
211218
function numfmt_parse_currency(NumberFormatter $fmt, string $value, &$currency, &$position = null): float|false {}
212219

213220
/** @param int|float $value */
@@ -251,12 +258,15 @@ function grapheme_strstr(string $haystack, string $needle, bool $before_needle =
251258

252259
function grapheme_stristr(string $haystack, string $needle, bool $before_needle = false): string|false {}
253260

261+
/** @param int $next */
254262
function grapheme_extract(string $haystack, int $size, int $extract_type = GRAPHEME_EXTR_COUNT, int $start = 0, &$next = null): string|false {}
255263

256264
/* idn */
257265

266+
/** @param array $idna_info */
258267
function idn_to_ascii(string $domain, int $options = 0, int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false {}
259268

269+
/** @param array $idna_info */
260270
function idn_to_utf8(string $domain, int $options = 0, int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false {}
261271

262272
/* locale */

ext/intl/php_intl_arginfo.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: a41f168369315619a8cf4bd3ed341b90b455ea1d */
2+
* Stub hash: ef46b927a82d0bdecea9438ff6ba0000b73b3b56 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlcal_create_instance, 0, 0, IntlCalendar, 1)
55
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timeZone, "null")
@@ -55,7 +55,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_intlcal_set, 0, 3, _IS_BOOL, 0)
5555
ZEND_ARG_TYPE_INFO(0, year, IS_LONG, 0)
5656
ZEND_ARG_TYPE_INFO(0, month, IS_LONG, 0)
5757
ZEND_ARG_TYPE_INFO(0, dayOfMonth, IS_LONG, 0)
58-
ZEND_ARG_INFO(0, hour)
58+
ZEND_ARG_TYPE_INFO(0, hour, IS_LONG, 0)
5959
ZEND_ARG_TYPE_INFO(0, minute, IS_LONG, 0)
6060
ZEND_ARG_TYPE_INFO(0, second, IS_LONG, 0)
6161
ZEND_END_ARG_INFO()

ext/ldap/ldap.stub.php

+21-8
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ function ldap_control_paged_result($link, int $pagesize, bool $iscritical = fals
204204
/**
205205
* @param resource $link
206206
* @param resource $result
207+
* @param string $cookie
208+
* @param int $estimated
207209
* @deprecated since 7.4
208210
*/
209211
function ldap_control_paged_result_response($link, $result, &$cookie = null, &$estimated = null): bool {}
@@ -220,10 +222,16 @@ function ldap_rename($link_identifier, string $dn, string $newrdn, string $newpa
220222
function ldap_rename_ext($link_identifier, string $dn, string $newrdn, string $newparent, bool $deleteoldrdn, array $servercontrols = []) {}
221223

222224

223-
/** @param resource $link_identifier */
225+
/**
226+
* @param resource $link_identifier
227+
* @param array|string|int $retval
228+
*/
224229
function ldap_get_option($link_identifier, int $option, &$retval = null): bool {}
225230

226-
/** @param resource|null $link_identifier */
231+
/**
232+
* @param resource|null $link_identifier
233+
* @param array|string|int|bool $newval
234+
*/
227235
function ldap_set_option($link_identifier, int $option, $newval): bool {}
228236

229237
/**
@@ -250,6 +258,7 @@ function ldap_next_reference($link, $entry) {}
250258
/**
251259
* @param resource $link
252260
* @param resource $entry
261+
* @param array $referrals
253262
*/
254263
function ldap_parse_reference($link, $entry, &$referrals): bool {}
255264
#endif
@@ -264,13 +273,12 @@ function ldap_parse_result($link, $result, &$errcode, &$matcheddn = null, &$errm
264273
#endif
265274

266275
#if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC)
267-
/**
268-
* @param resource $link
269-
*/
276+
/** @param resource $link */
270277
function ldap_set_rebind_proc($link, ?callable $callback): bool {}
271278
#endif
272279

273280
#ifdef HAVE_LDAP_START_TLS_S
281+
/** @param resource $link_identifier */
274282
function ldap_start_tls($link_identifier): bool {}
275283
#endif
276284

@@ -286,13 +294,18 @@ function ldap_8859_to_t61(string $value): string|false {}
286294
#ifdef HAVE_LDAP_EXTENDED_OPERATION_S
287295
/**
288296
* @param resource $link
297+
* @param string $retdata
298+
* @param string $retoid
289299
* @return resource|bool
290300
*/
291301
function ldap_exop($link, string $reqoid, ?string $reqdata = null, ?array $servercontrols = [], &$retdata = null, &$retoid = null) {}
292302
#endif
293303

294304
#ifdef HAVE_LDAP_PASSWD
295-
/** @param resource $link */
305+
/**
306+
* @param resource $link
307+
* @param array $serverctrls
308+
*/
296309
function ldap_exop_passwd($link, string $user = '', string $oldpw = '', string $newpw = '', &$serverctrls = null): string|bool {}
297310
#endif
298311

@@ -302,17 +315,17 @@ function ldap_exop_passwd($link, string $user = '', string $oldpw = '', string $
302315
function ldap_exop_whoami($link): string|bool {}
303316
#endif
304317

305-
306318
#ifdef HAVE_LDAP_REFRESH_S
307319
/** @param resource $link */
308320
function ldap_exop_refresh($link, string $dn, int $ttl): int|false {}
309321
#endif
310322

311-
312323
#ifdef HAVE_LDAP_PARSE_EXTENDED_RESULT
313324
/**
314325
* @param resource $link
315326
* @param resource $result
327+
* @param string $retdata
328+
* @param string $retoid
316329
*/
317330
function ldap_parse_exop($link, $result, &$retdata = null, &$retoid = null): bool {}
318331
#endif

ext/ldap/ldap_arginfo.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 63d7fc9e11bd2821a77f6ee709ceaf1fdcbf190e */
2+
* Stub hash: 9ecb7515850d95a20199b3c52aaccb8b2b04e0cd */
33

44
#if defined(HAVE_ORALDAP)
55
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_connect, 0, 0, 0)
@@ -344,7 +344,7 @@ ZEND_END_ARG_INFO()
344344
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ldap_exop_refresh, 0, 3, MAY_BE_LONG|MAY_BE_FALSE)
345345
ZEND_ARG_INFO(0, link)
346346
ZEND_ARG_TYPE_INFO(0, dn, IS_STRING, 0)
347-
ZEND_ARG_INFO(0, ttl)
347+
ZEND_ARG_TYPE_INFO(0, ttl, IS_LONG, 0)
348348
ZEND_END_ARG_INFO()
349349
#endif
350350

ext/posix/posix.stub.php

+2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ function posix_times(): array|false {}
6161
function posix_ctermid(): string|false {}
6262
#endif
6363

64+
/** @param resource|int $fd */
6465
function posix_ttyname($fd): string|false {}
6566

67+
/** @param resource|int $fd */
6668
function posix_isatty($fd): bool {}
6769

6870
function posix_getcwd(): string|false {}

ext/posix/posix_arginfo.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 8b74b3201e5a89a25d69753f3078e72ec0395500 */
2+
* Stub hash: c97ecb9b83ed873ca1ee2046ade191eef5bff25b */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_posix_kill, 0, 2, _IS_BOOL, 0)
55
ZEND_ARG_TYPE_INFO(0, pid, IS_LONG, 0)

ext/pspell/pspell.stub.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
function pspell_new(string $language, string $spelling = UNKNOWN, string $jargon = UNKNOWN, string $encoding = UNKNOWN, int $mode = 0): int|false {}
66

7-
function pspell_new_personal(string $personal, string $language, string $spelling = UNKNOWN, string $jargon = UNKNOWN, string $encoding = UNKNOWN, $mode = 0): int|false {}
7+
function pspell_new_personal(string $personal, string $language, string $spelling = UNKNOWN, string $jargon = UNKNOWN, string $encoding = UNKNOWN, int $mode = 0): int|false {}
88

99
function pspell_new_config(int $config): int|false {}
1010

ext/pspell/pspell_arginfo.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 83cadd382dfcccf598b743dfdccad09eb39e30c2 */
2+
* Stub hash: 9103420bb4162cad03e7ee06efa0d1c16820a099 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pspell_new, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
55
ZEND_ARG_TYPE_INFO(0, language, IS_STRING, 0)
@@ -15,7 +15,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pspell_new_personal, 0, 2, MAY_B
1515
ZEND_ARG_TYPE_INFO(0, spelling, IS_STRING, 0)
1616
ZEND_ARG_TYPE_INFO(0, jargon, IS_STRING, 0)
1717
ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
18-
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, mode, "0")
18+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0")
1919
ZEND_END_ARG_INFO()
2020

2121
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pspell_new_config, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)

ext/soap/soap.stub.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
function use_soap_error_handler(bool $handler = true): bool {}
66

7-
function is_soap_fault($object): bool {}
7+
function is_soap_fault(mixed $object): bool {}
88

99
class SoapParam
1010
{

ext/soap/soap_arginfo.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 82152767dbeda492da7dff97324d7277d3f0213b */
2+
* Stub hash: 14076c21ac68b4d1e88c1067e7d1f87373f1669e */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_use_soap_error_handler, 0, 0, _IS_BOOL, 0)
55
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, handler, _IS_BOOL, 0, "true")
66
ZEND_END_ARG_INFO()
77

88
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_is_soap_fault, 0, 1, _IS_BOOL, 0)
9-
ZEND_ARG_INFO(0, object)
9+
ZEND_ARG_TYPE_INFO(0, object, IS_MIXED, 0)
1010
ZEND_END_ARG_INFO()
1111

1212
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SoapParam___construct, 0, 0, 2)

ext/sysvmsg/sysvmsg.stub.php

+8
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@ final class SysvMessageQueue
88

99
function msg_get_queue(int $key, int $perms = 0666): SysvMessageQueue|false {}
1010

11+
/**
12+
* @param string|int|float|bool $message
13+
* @param int $errorcode
14+
*/
1115
function msg_send(SysvMessageQueue $queue, int $msgtype, $message, bool $serialize = true, bool $blocking = true, &$errorcode = null): bool {}
1216

17+
/**
18+
* @param int $msgtype
19+
* @param int $errorcode
20+
*/
1321
function msg_receive(SysvMessageQueue $queue, int $desiredmsgtype, &$msgtype, int $maxsize, &$message, bool $unserialize = true, int $flags = 0, &$errorcode = null): bool {}
1422

1523
function msg_remove_queue(SysvMessageQueue $queue): bool {}

ext/sysvmsg/sysvmsg_arginfo.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: a4e2f362d86b38827fbbea640e6b8db215c2e4aa */
2+
* Stub hash: 4954f0d4dd0515dea5e4305b9db9d3344bdf40a4 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_msg_get_queue, 0, 1, SysvMessageQueue, MAY_BE_FALSE)
55
ZEND_ARG_TYPE_INFO(0, key, IS_LONG, 0)

ext/xml/xml.stub.php

+5
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ function xml_set_end_namespace_decl_handler(XmlParser $parser, $hdl): bool {}
4040

4141
function xml_parse(XmlParser $parser, string $data, bool $isfinal = false): int {}
4242

43+
/**
44+
* @param array $values
45+
* @param array $index
46+
*/
4347
function xml_parse_into_struct(XmlParser $parser, string $data, &$values, &$index = null): int {}
4448

4549
function xml_get_error_code(XmlParser $parser): int {}
@@ -54,6 +58,7 @@ function xml_get_current_byte_index(XmlParser $parser): int {}
5458

5559
function xml_parser_free(XmlParser $parser): bool {}
5660

61+
/** @param string|int $value */
5762
function xml_parser_set_option(XmlParser $parser, int $option, $value): bool {}
5863

5964
function xml_parser_get_option(XmlParser $parser, int $option): string|int|false {}

0 commit comments

Comments
 (0)