From 673212d74262618ba9951b6d4f0797540a645a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Mon, 6 Sep 2021 13:02:32 +0200 Subject: [PATCH] Add more specific array return type hints for various extensions - part 4 --- Zend/Optimizer/zend_func_infos.h | 16 ++++++++++++++++ ext/posix/posix.stub.php | 32 ++++++++++++++++++++++++++++++++ ext/posix/posix_arginfo.h | 2 +- ext/pspell/pspell.stub.php | 5 +++++ ext/pspell/pspell_arginfo.h | 2 +- ext/readline/readline.stub.php | 4 ++++ ext/readline/readline_arginfo.h | 2 +- 7 files changed, 60 insertions(+), 3 deletions(-) diff --git a/Zend/Optimizer/zend_func_infos.h b/Zend/Optimizer/zend_func_infos.h index f92ee9b9ade13..43c44acb75686 100644 --- a/Zend/Optimizer/zend_func_infos.h +++ b/Zend/Optimizer/zend_func_infos.h @@ -383,6 +383,22 @@ static const func_info_t func_infos[] = { F1("pg_update", MAY_BE_STRING|MAY_BE_BOOL), F1("pg_delete", MAY_BE_STRING|MAY_BE_BOOL), F1("pg_select", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_STRING|MAY_BE_FALSE), +#if defined(HAVE_GETGROUPS) + F1("posix_getgroups", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_LONG|MAY_BE_FALSE), +#endif + F1("posix_uname", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE), + F1("posix_times", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_FALSE), + F1("posix_getgrnam", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_ARRAY_OF_NULL|MAY_BE_FALSE), + F1("posix_getgrgid", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_ARRAY_OF_NULL|MAY_BE_FALSE), + F1("posix_getpwnam", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE), + F1("posix_getpwuid", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE), +#if defined(HAVE_GETRLIMIT) + F1("posix_getrlimit", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE), +#endif + F1("pspell_suggest", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE), +#if defined(HAVE_HISTORY_LIST) + F1("readline_list_history", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING), +#endif F1("session_name", MAY_BE_STRING|MAY_BE_FALSE), F1("session_module_name", MAY_BE_STRING|MAY_BE_FALSE), F1("session_save_path", MAY_BE_STRING|MAY_BE_FALSE), diff --git a/ext/posix/posix.stub.php b/ext/posix/posix.stub.php index a15a3a5dc57f4..3904bae912d0b 100644 --- a/ext/posix/posix.stub.php +++ b/ext/posix/posix.stub.php @@ -29,6 +29,10 @@ function posix_setegid(int $group_id): bool {} #endif #ifdef HAVE_GETGROUPS +/** + * @return array|false + * @refcount 1 + */ function posix_getgroups(): array|false {} #endif @@ -52,8 +56,16 @@ function posix_getpgid(int $process_id): int|false {} function posix_getsid(int $process_id): int|false {} #endif +/** + * @return array|false + * @refcount 1 + */ function posix_uname(): array|false {} +/** + * @return array|false + * @refcount 1 + */ function posix_times(): array|false {} @@ -79,15 +91,35 @@ function posix_mknod(string $filename, int $flags, int $major = 0, int $minor = function posix_access(string $filename, int $flags = 0): bool {} +/** + * @return array|false + * @refcount 1 + */ function posix_getgrnam(string $name): array|false {} +/** + * @return array|false + * @refcount 1 + */ function posix_getgrgid(int $group_id): array|false {} +/** + * @return array|false + * @refcount 1 + */ function posix_getpwnam(string $username): array|false {} +/** + * @return array|false + * @refcount 1 + */ function posix_getpwuid(int $user_id): array|false {} #ifdef HAVE_GETRLIMIT +/** + * @return array|false + * @refcount 1 + */ function posix_getrlimit(): array|false {} #endif diff --git a/ext/posix/posix_arginfo.h b/ext/posix/posix_arginfo.h index 40f2dc4393075..19c423fab16d3 100644 --- a/ext/posix/posix_arginfo.h +++ b/ext/posix/posix_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 954c403785617dade95048b4345a34d4ec5d91c3 */ + * Stub hash: b8806b9b67bf24cc64fe1957306f1c720a61ea58 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_posix_kill, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, process_id, IS_LONG, 0) diff --git a/ext/pspell/pspell.stub.php b/ext/pspell/pspell.stub.php index 3f0eb8a20eb2c..3e19e58da8a35 100644 --- a/ext/pspell/pspell.stub.php +++ b/ext/pspell/pspell.stub.php @@ -34,6 +34,11 @@ function pspell_new_personal( function pspell_new_config(PSpell\Config $config): PSpell\Dictionary|false {} function pspell_check(PSpell\Dictionary $dictionary, string $word): bool {} + + /** + * @return array|false + * @refcount 1 + */ function pspell_suggest(PSpell\Dictionary $dictionary, string $word): array|false {} function pspell_store_replacement(PSpell\Dictionary $dictionary, string $misspelled, string $correct): bool {} function pspell_add_to_personal(PSpell\Dictionary $dictionary, string $word): bool {} diff --git a/ext/pspell/pspell_arginfo.h b/ext/pspell/pspell_arginfo.h index 190977d401c3b..59741e2cd07b0 100644 --- a/ext/pspell/pspell_arginfo.h +++ b/ext/pspell/pspell_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 04660f3f9559eed67a224d219d38ff80d131b118 */ + * Stub hash: 54253af8d28520254e062171733c753d7104ec6b */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_pspell_new, 0, 1, PSpell\\Dictionary, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, language, IS_STRING, 0) diff --git a/ext/readline/readline.stub.php b/ext/readline/readline.stub.php index 53bb199dbc34b..804b02fde38c2 100644 --- a/ext/readline/readline.stub.php +++ b/ext/readline/readline.stub.php @@ -12,6 +12,10 @@ function readline_add_history(string $prompt): bool {} function readline_clear_history(): bool {} #ifdef HAVE_HISTORY_LIST +/** + * @return array + * @refcount 1 + */ function readline_list_history(): array {} #endif diff --git a/ext/readline/readline_arginfo.h b/ext/readline/readline_arginfo.h index af1ee56c4a30c..de539fd3310cc 100644 --- a/ext/readline/readline_arginfo.h +++ b/ext/readline/readline_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: aab1331f5ba0d8beeb62d5961ece7dc96a99a74c */ + * Stub hash: 1839e2895847790ef3db4263d4940fa1bc956ff2 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_readline, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, prompt, IS_STRING, 1, "null")