Skip to content

Commit 5a79215

Browse files
committed
Add more specific array return type hints for various extensions - part 5
1 parent c8f858e commit 5a79215

19 files changed

+110
-19
lines changed

Zend/Optimizer/zend_func_infos.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,9 @@ static const func_info_t func_infos[] = {
682682
F1("convert_uudecode", MAY_BE_STRING|MAY_BE_FALSE),
683683
F1("var_export", MAY_BE_STRING|MAY_BE_NULL),
684684
F1("serialize", MAY_BE_STRING),
685+
F1("msg_stat_queue", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_FALSE),
686+
F1("tidy_get_config", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_FALSE|MAY_BE_ARRAY_OF_TRUE|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING),
687+
F1("token_get_all", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ARRAY),
685688
F1("xml_error_string", MAY_BE_STRING|MAY_BE_NULL),
686689
F1("xml_parser_get_option", MAY_BE_STRING|MAY_BE_LONG),
687690
FN("zip_open", MAY_BE_RESOURCE|MAY_BE_LONG|MAY_BE_FALSE),
@@ -698,4 +701,8 @@ static const func_info_t func_infos[] = {
698701
F1("gzinflate", MAY_BE_STRING|MAY_BE_FALSE),
699702
F1("gzdecode", MAY_BE_STRING|MAY_BE_FALSE),
700703
F1("gzuncompress", MAY_BE_STRING|MAY_BE_FALSE),
704+
F1("fpm_get_status", 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_FALSE),
705+
F1("litespeed_request_headers", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING),
706+
F1("litespeed_response_headers", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
707+
F1("phpdbg_get_executable", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ARRAY),
701708
};

ext/sysvmsg/sysvmsg.stub.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ function msg_receive(
3535

3636
function msg_remove_queue(SysvMessageQueue $queue): bool {}
3737

38+
/**
39+
* @return array<string, int>|false
40+
* @refcount 1
41+
*/
3842
function msg_stat_queue(SysvMessageQueue $queue): array|false {}
3943

4044
function msg_set_queue(SysvMessageQueue $queue, array $data): bool {}

ext/sysvmsg/sysvmsg_arginfo.h

Lines changed: 1 addition & 1 deletion
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: 7acab08abf78d75df333fccd6c47266823a92103 */
2+
* Stub hash: ea292758c1118e90b2c2e1f23883d107363d5801 */
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/tidy/tidy.stub.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ function tidy_get_release(): string {}
2424
function tidy_get_opt_doc(tidy $tidy, string $option): string|false {}
2525
#endif
2626

27+
/**
28+
* @return array<string, bool|int|string>
29+
* @refcount 1
30+
*/
2731
function tidy_get_config(tidy $tidy): array {}
2832

2933
function tidy_get_status(tidy $tidy): int {}
@@ -99,6 +103,7 @@ public function diagnose(): bool {}
99103
public function getRelease(): string {}
100104

101105
/**
106+
* @return array<string, bool|int|string>
102107
* @tentative-return-type
103108
* @alias tidy_get_config
104109
*/

ext/tidy/tidy_arginfo.h

Lines changed: 1 addition & 1 deletion
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: 4e5f6c0e7c6b8a6939a13276e3e68d2614a73d7e */
2+
* Stub hash: fd1aedcfc9ff4fc6d0819e6b3502c05fb5234fc5 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_tidy_parse_string, 0, 1, tidy, MAY_BE_FALSE)
55
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)

ext/tokenizer/tokenizer.stub.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

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

5+
/**
6+
* @return array<int, array>
7+
* @refcount 1
8+
*/
59
function token_get_all(string $code, int $flags = 0): array {}
610

711
function token_name(int $id): string {}

ext/tokenizer/tokenizer_arginfo.h

Lines changed: 1 addition & 1 deletion
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: 60b4c809624eb4c1ef610e5c5820acfc87f6b07f */
2+
* Stub hash: adba76b3f96e8da4a5ea2ff19ed5a61a3875002f */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_token_get_all, 0, 1, IS_ARRAY, 0)
55
ZEND_ARG_TYPE_INFO(0, code, IS_STRING, 0)

sapi/apache2handler/php_functions.stub.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,22 @@ function apache_lookup_uri(string $filename): object|false {}
66

77
function virtual(string $uri): bool {}
88

9+
/**
10+
* @return array<string, string>
11+
* @refcount 1
12+
*/
913
function apache_request_headers(): array {}
1014

11-
/** @alias apache_request_headers */
15+
/**
16+
* @return array<string, string>
17+
* @alias apache_request_headers
18+
*/
1219
function getallheaders(): array {}
1320

21+
/**
22+
* @return array<string, string>
23+
* @refcount 1
24+
*/
1425
function apache_response_headers(): array {}
1526

1627
function apache_note(string $note_name, ?string $note_value = null): string|false {}
@@ -21,4 +32,8 @@ function apache_getenv(string $variable, bool $walk_to_top = false): string|fals
2132

2233
function apache_get_version(): string|false {}
2334

35+
/**
36+
* @return array<int, string>
37+
* @refcount 1
38+
*/
2439
function apache_get_modules(): array {}

sapi/apache2handler/php_functions_arginfo.h

Lines changed: 1 addition & 1 deletion
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: 130666f6f971fe7b43a450d922e4b3d092e78667 */
2+
* Stub hash: 0bedb66b9075e97871863e2700316f6448dfdcb2 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_apache_lookup_uri, 0, 1, MAY_BE_OBJECT|MAY_BE_FALSE)
55
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)

sapi/cgi/cgi_main.stub.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,20 @@
44

55
function apache_child_terminate(): void {}
66

7+
/**
8+
* @return array<string, string>
9+
* @refcount 1
10+
*/
711
function apache_request_headers(): array {}
812

9-
/** @alias apache_request_headers */
13+
/**
14+
* @return array<string, string>
15+
* @alias apache_request_headers
16+
*/
1017
function getallheaders(): array {}
1118

19+
/**
20+
* @return array<string, string>
21+
* @refcount 1
22+
*/
1223
function apache_response_headers(): array {}

sapi/cgi/cgi_main_arginfo.h

Lines changed: 1 addition & 1 deletion
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: df963adc6bc610cdd31861036889141fa9464ded */
2+
* Stub hash: 0bb44f898b32fb2b83865432c081ad796ca2436a */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_apache_child_terminate, 0, 0, IS_VOID, 0)
55
ZEND_END_ARG_INFO()

sapi/cli/php_cli_server.stub.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
<?php
22

3+
/**
4+
* @return array<string, string>
5+
* @refcount 1
6+
*/
37
function apache_request_headers(): array {}
48

5-
function apache_response_headers(): array {}
6-
9+
/**
10+
* @return array<string, string>
11+
* @alias apache_request_headers
12+
*/
713
function getallheaders(): array {}
14+
15+
/**
16+
* @return array<string, string>
17+
* @refcount 1
18+
*/
19+
function apache_response_headers(): array {}

sapi/cli/php_cli_server_arginfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 60cd531d36a34fe7c51982e9ec40b45d2a2a4ce7 */
2+
* Stub hash: 989efabf5eb29593017b16d62d41c7920760435d */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_apache_request_headers, 0, 0, IS_ARRAY, 0)
55
ZEND_END_ARG_INFO()
66

7-
#define arginfo_apache_response_headers arginfo_apache_request_headers
8-
97
#define arginfo_getallheaders arginfo_apache_request_headers
8+
9+
#define arginfo_apache_response_headers arginfo_apache_request_headers

sapi/fpm/fpm/fpm_main.stub.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,20 @@
44

55
function fastcgi_finish_request(): bool {}
66

7+
/**
8+
* @return array<string, string>
9+
* @refcount 1
10+
*/
711
function apache_request_headers(): array {}
812

9-
/** @alias apache_request_headers */
13+
/**
14+
* @return array<string, string>
15+
* @alias apache_request_headers
16+
*/
1017
function getallheaders(): array {}
1118

19+
/**
20+
* @return array<string, int|string|array>|false
21+
* @refcount 1
22+
*/
1223
function fpm_get_status(): array|false {}

sapi/fpm/fpm/fpm_main_arginfo.h

Lines changed: 1 addition & 1 deletion
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: b4ac4c0f1d91c354293e21185a2e6d9f99cc9fcc */
2+
* Stub hash: b9e9164e2a07a33cc5c1efd6b710a505d64696cf */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_fastcgi_finish_request, 0, 0, _IS_BOOL, 0)
55
ZEND_END_ARG_INFO()

sapi/litespeed/lsapi_main.stub.php

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,35 @@
22

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

5+
/**
6+
* @return array<string, string>
7+
* @refcount 1
8+
*/
59
function litespeed_request_headers(): array {}
610

7-
/** @alias litespeed_request_headers */
11+
/**
12+
* @return array<string, string>
13+
* @refcount 1
14+
* @alias litespeed_request_headers
15+
*/
816
function getallheaders(): array {}
917

10-
/** @alias litespeed_request_headers */
18+
/**
19+
* @return array<string, string>
20+
* @alias litespeed_request_headers
21+
*/
1122
function apache_request_headers(): array {}
1223

24+
/**
25+
* @return array<string, string>|false
26+
* @refcount 1
27+
*/
1328
function litespeed_response_headers(): array|false {}
1429

15-
/** @alias litespeed_response_headers */
30+
/**
31+
* @return array<string, string>|false
32+
* @alias litespeed_response_headers
33+
*/
1634
function apache_response_headers(): array|false {}
1735

1836
function apache_get_modules(): array {}

sapi/litespeed/lsapi_main_arginfo.h

Lines changed: 1 addition & 1 deletion
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: 3419f4e77bd091e09e0cfc55d81f443d5a3396ff */
2+
* Stub hash: a7b80048c40a6e6d530d92f27c4b8c4ea455dbcc */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_litespeed_request_headers, 0, 0, IS_ARRAY, 0)
55
ZEND_END_ARG_INFO()

sapi/phpdbg/phpdbg.stub.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ function phpdbg_start_oplog(): void {}
2222

2323
function phpdbg_end_oplog(array $options = []): ?array {}
2424

25+
/**
26+
* @return array<string, array>
27+
* @refcount 1
28+
*/
2529
function phpdbg_get_executable(array $options = []): array {}

sapi/phpdbg/phpdbg_arginfo.h

Lines changed: 1 addition & 1 deletion
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: dc2e5420ea396c6235429c9606875ad2332811cb */
2+
* Stub hash: 18a28c3d2b1d3cc0f4afe3b173a6daa619fe9af1 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phpdbg_break_next, 0, 0, IS_VOID, 0)
55
ZEND_END_ARG_INFO()

0 commit comments

Comments
 (0)