mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Add more specific array return type hints for various extensions - part 2
ext/ftp, ext/gmp, ext/intl Closes GH-7433
This commit is contained in:
parent
42ccf9354a
commit
20fb26e55c
21 changed files with 106 additions and 13 deletions
|
@ -95,6 +95,10 @@ static const func_info_t func_infos[] = {
|
|||
F1("filter_input_array", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF|MAY_BE_FALSE|MAY_BE_NULL),
|
||||
F1("filter_var_array", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF|MAY_BE_FALSE|MAY_BE_NULL),
|
||||
F1("filter_list", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
|
||||
F1("ftp_raw", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_NULL),
|
||||
F1("ftp_nlist", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
|
||||
F1("ftp_rawlist", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
|
||||
F1("ftp_mlsd", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_FALSE),
|
||||
F1("gd_info", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_FALSE|MAY_BE_ARRAY_OF_TRUE),
|
||||
F1("imagecreatetruecolor", MAY_BE_OBJECT|MAY_BE_FALSE),
|
||||
#if defined(PHP_WIN32)
|
||||
|
@ -163,6 +167,10 @@ static const func_info_t func_infos[] = {
|
|||
#if defined(HAVE_BIND_TEXTDOMAIN_CODESET)
|
||||
F1("bind_textdomain_codeset", MAY_BE_STRING|MAY_BE_FALSE),
|
||||
#endif
|
||||
F1("gmp_div_qr", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_OBJECT),
|
||||
F1("gmp_sqrtrem", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_OBJECT),
|
||||
F1("gmp_rootrem", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_OBJECT),
|
||||
F1("gmp_gcdext", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_OBJECT),
|
||||
F1("hash", MAY_BE_STRING|MAY_BE_FALSE),
|
||||
F1("hash_file", MAY_BE_STRING|MAY_BE_FALSE),
|
||||
F1("hash_hmac", MAY_BE_STRING|MAY_BE_FALSE),
|
||||
|
@ -189,6 +197,13 @@ static const func_info_t func_infos[] = {
|
|||
F1("iconv_mime_decode_headers", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_FALSE),
|
||||
F1("iconv", MAY_BE_STRING|MAY_BE_FALSE),
|
||||
F1("iconv_get_encoding", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_STRING|MAY_BE_FALSE),
|
||||
F1("intlcal_get_available_locales", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
|
||||
F1("datefmt_localtime", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_FALSE),
|
||||
F1("locale_get_keywords", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE|MAY_BE_NULL),
|
||||
F1("msgfmt_parse", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_DOUBLE|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
|
||||
F1("msgfmt_parse_message", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_DOUBLE|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
|
||||
F1("resourcebundle_locales", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
|
||||
F1("transliterator_list_ids", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
|
||||
F1("json_encode", MAY_BE_STRING|MAY_BE_FALSE),
|
||||
F1("json_last_error_msg", MAY_BE_STRING),
|
||||
F1("ldap_get_entries", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_FALSE),
|
||||
|
|
|
@ -27,6 +27,11 @@ namespace {
|
|||
function ftp_cdup(FTP\Connection $ftp): bool {}
|
||||
function ftp_chdir(FTP\Connection $ftp, string $directory): bool {}
|
||||
function ftp_exec(FTP\Connection $ftp, string $command): bool {}
|
||||
|
||||
/**
|
||||
* @return array<int, string>|null
|
||||
* @refcount 1
|
||||
*/
|
||||
function ftp_raw(FTP\Connection $ftp, string $command): ?array {}
|
||||
function ftp_mkdir(FTP\Connection $ftp, string $directory): string|false {}
|
||||
function ftp_rmdir(FTP\Connection $ftp, string $directory): bool {}
|
||||
|
@ -34,9 +39,25 @@ namespace {
|
|||
|
||||
/** @param string $response */
|
||||
function ftp_alloc(FTP\Connection $ftp, int $size, &$response = null): bool {}
|
||||
|
||||
/**
|
||||
* @return array<int, string>|false
|
||||
* @refcount 1
|
||||
*/
|
||||
function ftp_nlist(FTP\Connection $ftp, string $directory): array|false {}
|
||||
|
||||
/**
|
||||
* @return array<int, string>|false
|
||||
* @refcount 1
|
||||
*/
|
||||
function ftp_rawlist(FTP\Connection $ftp, string $directory, bool $recursive = false): array|false {}
|
||||
|
||||
/**
|
||||
* @return array<int, array>|false
|
||||
* @refcount 1
|
||||
*/
|
||||
function ftp_mlsd(FTP\Connection $ftp, string $directory): array|false {}
|
||||
|
||||
function ftp_systype(FTP\Connection $ftp): string|false {}
|
||||
|
||||
/** @param resource $stream */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 6de0997e9f07a8e1079764ab1841d3ac4651cc53 */
|
||||
* Stub hash: 2b1726dd5652839a37e533e20dfcf6782b3c766d */
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_ftp_connect, 0, 1, FTP\\Connection, MAY_BE_FALSE)
|
||||
ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0)
|
||||
|
|
|
@ -22,6 +22,10 @@ function gmp_sub(GMP|int|string $num1, GMP|int|string $num2): GMP {}
|
|||
|
||||
function gmp_mul(GMP|int|string $num1, GMP|int|string $num2): GMP {}
|
||||
|
||||
/**
|
||||
* @return array<int, GMP>
|
||||
* @refcount 1
|
||||
*/
|
||||
function gmp_div_qr(GMP|int|string $num1, GMP|int|string $num2, int $rounding_mode = GMP_ROUND_ZERO): array {}
|
||||
|
||||
function gmp_div_q(GMP|int|string $num1, GMP|int|string $num2, int $rounding_mode = GMP_ROUND_ZERO): GMP {}
|
||||
|
@ -43,10 +47,18 @@ function gmp_fact(GMP|int|string $num): GMP {}
|
|||
|
||||
function gmp_sqrt(GMP|int|string $num): GMP {}
|
||||
|
||||
/**
|
||||
* @return array<int, GMP>
|
||||
* @refcount 1
|
||||
*/
|
||||
function gmp_sqrtrem(GMP|int|string $num): array {}
|
||||
|
||||
function gmp_root(GMP|int|string $num, int $nth): GMP {}
|
||||
|
||||
/**
|
||||
* @return array<int, GMP>
|
||||
* @refcount 1
|
||||
*/
|
||||
function gmp_rootrem(GMP|int|string $num, int $nth): array {}
|
||||
|
||||
function gmp_pow(GMP|int|string $num, int $exponent): GMP {}
|
||||
|
@ -61,6 +73,10 @@ function gmp_prob_prime(GMP|int|string $num, int $repetitions = 10): int {}
|
|||
|
||||
function gmp_gcd(GMP|int|string $num1, GMP|int|string $num2): GMP {}
|
||||
|
||||
/**
|
||||
* @return array<string, GMP>
|
||||
* @refcount 1
|
||||
*/
|
||||
function gmp_gcdext(GMP|int|string $num1, GMP|int|string $num2): array {}
|
||||
|
||||
function gmp_lcm(GMP|int|string $num1, GMP|int|string $num2): GMP {}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 69215fb94adb4156c974360e5698e842471cb27d */
|
||||
* Stub hash: 05e618ec428bd8769410153469c42cbc923ea77f */
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_init, 0, 1, GMP, 0)
|
||||
ZEND_ARG_TYPE_MASK(0, num, MAY_BE_LONG|MAY_BE_STRING, NULL)
|
||||
|
|
|
@ -74,6 +74,7 @@ class IntlCalendar
|
|||
public function getActualMinimum(int $field): int|false {}
|
||||
|
||||
/**
|
||||
* @return array<int, string>
|
||||
* @tentative-return-type
|
||||
* @alias intlcal_get_available_locales
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 2265c2a4f478d6ccd576ce09a19a158df38a2bdb */
|
||||
* Stub hash: 7be0e49d2b898587c4bbefaaf613932ae4786c52 */
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlCalendar___construct, 0, 0, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
|
|
@ -15,10 +15,16 @@ class UConverter
|
|||
*/
|
||||
public function fromUCallback(int $reason, array $source, int $codePoint, &$error): string|int|array|null {}
|
||||
|
||||
/** @tentative-return-type */
|
||||
/**
|
||||
* @return array<int, string>|false|null
|
||||
* @tentative-return-type
|
||||
*/
|
||||
public static function getAliases(string $name): array|false|null {}
|
||||
|
||||
/** @tentative-return-type */
|
||||
/**
|
||||
* @return array<int, string>
|
||||
* @tentative-return-type
|
||||
*/
|
||||
public static function getAvailable(): array {}
|
||||
|
||||
/** @tentative-return-type */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: a6b352ba1b6ad2367bd4705ac941e763f74c8fac */
|
||||
* Stub hash: 2a6d8499e1a2d414130e366783a1c084f47a3293 */
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_UConverter___construct, 0, 0, 0)
|
||||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, destination_encoding, IS_STRING, 1, "null")
|
||||
|
|
|
@ -134,6 +134,7 @@ class IntlDateFormatter
|
|||
|
||||
/**
|
||||
* @param int $offset
|
||||
* @return array<string, int>|false
|
||||
* @tentative-return-type
|
||||
* @alias datefmt_localtime
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 767e5d064aef6d68f860a79c721eb728436c4eb9 */
|
||||
* Stub hash: 82f90e7b0528b2b3515c086763dba4de0f92dfa7 */
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter___construct, 0, 0, 1)
|
||||
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 1)
|
||||
|
|
|
@ -35,6 +35,7 @@ class Locale
|
|||
public static function getRegion(string $locale): ?string {}
|
||||
|
||||
/**
|
||||
* @return array<string, string>|false|null
|
||||
* @tentative-return-type
|
||||
* @alias locale_get_keywords
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: a0c2cf74b0d2e8309f0cd39fd9969d14586d0988 */
|
||||
* Stub hash: 539e559bc038e18358540b3b3f4db7b09e532dae */
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Locale_getDefault, 0, 0, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
|
|
@ -25,12 +25,14 @@ class MessageFormatter
|
|||
public static function formatMessage(string $locale, string $pattern, array $values): string|false {}
|
||||
|
||||
/**
|
||||
* @return array<int, int|float|string>|false
|
||||
* @tentative-return-type
|
||||
* @alias msgfmt_parse
|
||||
*/
|
||||
public function parse(string $string): array|false {}
|
||||
|
||||
/**
|
||||
* @return array<int, int|float|string>|false
|
||||
* @tentative-return-type
|
||||
* @alias msgfmt_parse_message
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 3fc29ffe87caf85a84e97470d0b59a26c801457c */
|
||||
* Stub hash: 44bc7b87c0b6c674bf94764b3f036006e3933713 */
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MessageFormatter___construct, 0, 0, 2)
|
||||
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0)
|
||||
|
|
|
@ -15,6 +15,10 @@ function intlcal_get_keyword_values_for_locale(string $keyword, string $locale,
|
|||
|
||||
function intlcal_get_now(): float {}
|
||||
|
||||
/**
|
||||
* @return array<int, string>
|
||||
* @refcount 1
|
||||
*/
|
||||
function intlcal_get_available_locales(): array {}
|
||||
|
||||
function intlcal_get(IntlCalendar $calendar, int $field): int|false {}
|
||||
|
@ -206,7 +210,11 @@ function datefmt_format_object($datetime, $format = null, ?string $locale = null
|
|||
/** @param int $offset */
|
||||
function datefmt_parse(IntlDateFormatter $formatter, string $string, &$offset = null): int|float|false {}
|
||||
|
||||
/** @param int $offset */
|
||||
/**
|
||||
* @param int $offset
|
||||
* @return array<string, int>|false
|
||||
* @refcount 1
|
||||
*/
|
||||
function datefmt_localtime(IntlDateFormatter $formatter, string $string, &$offset = null): array|false {}
|
||||
|
||||
function datefmt_get_error_code(IntlDateFormatter $formatter): int {}
|
||||
|
@ -294,6 +302,10 @@ function locale_get_script(string $locale): ?string {}
|
|||
|
||||
function locale_get_region(string $locale): ?string {}
|
||||
|
||||
/**
|
||||
* @return array<string, string>|false|null
|
||||
* @refcount 1
|
||||
*/
|
||||
function locale_get_keywords(string $locale): array|false|null {}
|
||||
|
||||
function locale_get_display_script(string $locale, ?string $displayLocale = null): string|false {}
|
||||
|
@ -328,8 +340,16 @@ function msgfmt_format(MessageFormatter $formatter, array $values): string|false
|
|||
|
||||
function msgfmt_format_message(string $locale, string $pattern, array $values): string|false {}
|
||||
|
||||
/**
|
||||
* @return array<int, int|float|string>|false
|
||||
* @refcount 1
|
||||
*/
|
||||
function msgfmt_parse(MessageFormatter $formatter, string $string): array|false {}
|
||||
|
||||
/**
|
||||
* @return array<int, int|float|string>|false
|
||||
* @refcount 1
|
||||
*/
|
||||
function msgfmt_parse_message(string $locale, string $pattern, string $message): array|false {}
|
||||
|
||||
function msgfmt_set_pattern(MessageFormatter $formatter, string $pattern): bool {}
|
||||
|
@ -361,6 +381,10 @@ function resourcebundle_get(ResourceBundle $bundle, $index, bool $fallback = tru
|
|||
|
||||
function resourcebundle_count(ResourceBundle $bundle): int {}
|
||||
|
||||
/**
|
||||
* @return array<int, string>|false
|
||||
* @refcount 1
|
||||
*/
|
||||
function resourcebundle_locales(string $bundle): array|false {}
|
||||
|
||||
function resourcebundle_get_error_code(ResourceBundle $bundle): int {}
|
||||
|
@ -431,6 +455,10 @@ function transliterator_create(string $id, int $direction = Transliterator::FORW
|
|||
|
||||
function transliterator_create_from_rules(string $rules, int $direction = Transliterator::FORWARD): ?Transliterator {}
|
||||
|
||||
/**
|
||||
* @return array<int, string>|false
|
||||
* @refcount 1
|
||||
*/
|
||||
function transliterator_list_ids(): array|false {}
|
||||
|
||||
function transliterator_create_inverse(Transliterator $transliterator): ?Transliterator {}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: dc9632b2417200deb39cc5cce25aa26a44128707 */
|
||||
* Stub hash: 09aa0aa66c78b86c0e6e0e554c3ebe205a0e5f59 */
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlcal_create_instance, 0, 0, IntlCalendar, 1)
|
||||
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timezone, "null")
|
||||
|
|
|
@ -26,6 +26,7 @@ class ResourceBundle implements IteratorAggregate, Countable
|
|||
public function count(): int {}
|
||||
|
||||
/**
|
||||
* @return array<int, string>|false
|
||||
* @tentative-return-type
|
||||
* @alias resourcebundle_locales
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: a299d2a45a3575e6da71560979e2f9301b3c952f */
|
||||
* Stub hash: d27fa5a4dc092b94e48fc876070f440c247fa6c2 */
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ResourceBundle___construct, 0, 0, 2)
|
||||
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 1)
|
||||
|
|
|
@ -27,6 +27,7 @@ class Transliterator
|
|||
public function createInverse(): ?Transliterator {}
|
||||
|
||||
/**
|
||||
* @return array<int, string>|false
|
||||
* @tentative-return-type
|
||||
* @alias transliterator_list_ids
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: fbc9a196271c276e5af658115571cacde2ad3a3a */
|
||||
* Stub hash: 8a6aaab7dd89a014726bd1fdf1f40f7b6fa98ea5 */
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Transliterator___construct, 0, 0, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue