Skip to content

Commit 6a47831

Browse files
authored
Add more specific array return type hints for various extensions - part 3 (#7467)
1 parent a55c638 commit 6a47831

File tree

9 files changed

+46
-5
lines changed

9 files changed

+46
-5
lines changed

Zend/Optimizer/zend_func_infos.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ static const func_info_t func_infos[] = {
181181
F1("iconv_get_encoding", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_STRING|MAY_BE_FALSE),
182182
F1("json_encode", MAY_BE_STRING|MAY_BE_FALSE),
183183
F1("json_last_error_msg", MAY_BE_STRING),
184+
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),
185+
F1("ldap_get_attributes", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY),
186+
F1("ldap_get_values_len", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
187+
F1("ldap_explode_dn", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
188+
FN("libxml_get_errors", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_OBJECT),
184189
F1("mb_language", MAY_BE_STRING|MAY_BE_BOOL),
185190
F1("mb_internal_encoding", MAY_BE_STRING|MAY_BE_BOOL),
186191
F1("mb_http_input", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_STRING|MAY_BE_FALSE),
@@ -326,12 +331,15 @@ static const func_info_t func_infos[] = {
326331
#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) &&!defined(HAVE_SOLID_35)
327332
FN("odbc_columnprivileges", MAY_BE_RESOURCE|MAY_BE_FALSE),
328333
#endif
334+
F1("opcache_get_status", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_FALSE),
335+
F1("opcache_get_configuration", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_FALSE),
329336
FN("pcntl_signal_get_handler", MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_OBJECT|MAY_BE_LONG),
330337
FN("preg_replace", MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_NULL),
331338
FN("preg_filter", MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_NULL),
332339
FN("preg_replace_callback", MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_NULL),
333340
F1("preg_split", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_FALSE),
334341
F1("preg_grep", 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),
342+
F1("pdo_drivers", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING),
335343
F1("pg_dbname", MAY_BE_STRING),
336344
F1("pg_options", MAY_BE_STRING),
337345
F1("pg_port", MAY_BE_STRING),

ext/ldap/ldap.stub.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,41 @@ function ldap_first_entry(LDAP\Connection $ldap, LDAP\Result $result): LDAP\Resu
6868

6969
function ldap_next_entry(LDAP\Connection $ldap, LDAP\ResultEntry $entry): LDAP\ResultEntry|false {}
7070

71+
/**
72+
* @return array<int|string, int|array>|false
73+
* @refcount 1
74+
*/
7175
function ldap_get_entries(LDAP\Connection $ldap, LDAP\Result $result): array|false {}
7276

7377
function ldap_first_attribute(LDAP\Connection $ldap, LDAP\ResultEntry $entry): string|false {}
7478

7579
function ldap_next_attribute(LDAP\Connection $ldap, LDAP\ResultEntry $entry): string|false {}
7680

81+
/**
82+
* @return array<int|string, int|string|array>
83+
* @refcount 1
84+
*/
7785
function ldap_get_attributes(LDAP\Connection $ldap, LDAP\ResultEntry $entry): array {}
7886

87+
/**
88+
* @return array<int|string, int|string>|false
89+
* @refcount 1
90+
*/
7991
function ldap_get_values_len(LDAP\Connection $ldap, LDAP\ResultEntry $entry, string $attribute): array|false {}
8092

81-
/** @alias ldap_get_values_len */
93+
/**
94+
* @return array<int|string, int|string>|false
95+
* @refcount 1
96+
* @alias ldap_get_values_len
97+
*/
8298
function ldap_get_values(LDAP\Connection $ldap, LDAP\ResultEntry $entry, string $attribute): array|false {}
8399

84100
function ldap_get_dn(LDAP\Connection $ldap, LDAP\ResultEntry $entry): string|false {}
85101

102+
/**
103+
* @return array<int|string, int|string>|false
104+
* @refcount 1
105+
*/
86106
function ldap_explode_dn(string $dn, int $with_attrib): array|false {}
87107

88108
function ldap_dn2ufn(string $dn): string|false {}

ext/ldap/ldap_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: a1beb155767af8500567030b493d9d3ec408270a */
2+
* Stub hash: 9f90cc4f751725c503bf4afd2b6c5e5b4e0379c8 */
33

44
#if defined(HAVE_ORALDAP)
55
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_ldap_connect, 0, 0, LDAP\\Connection, MAY_BE_FALSE)

ext/libxml/libxml.stub.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ function libxml_use_internal_errors(?bool $use_errors = null): bool {}
1919

2020
function libxml_get_last_error(): LibXMLError|false {}
2121

22+
/** @return array<int, LibXMLError> */
2223
function libxml_get_errors(): array {}
2324

2425
function libxml_clear_errors(): void {}

ext/libxml/libxml_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: 252fdc1cd83d2d3322cc040baf2bf3c7fde29254 */
2+
* Stub hash: 4bde2f5c4e55b6e0c273b0d8605cb765cc9f8400 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_libxml_set_streams_context, 0, 1, IS_VOID, 0)
55
ZEND_ARG_INFO(0, context)

ext/opcache/opcache.stub.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,20 @@
44

55
function opcache_reset(): bool {}
66

7+
/**
8+
* @return array<string, mixed>|false
9+
* @refcount 1
10+
*/
711
function opcache_get_status(bool $include_scripts = true): array|false {}
812

913
function opcache_compile_file(string $filename): bool {}
1014

1115
function opcache_invalidate(string $filename, bool $force = false): bool {}
1216

17+
/**
18+
* @return array<string, mixed>|false
19+
* @refcount 1
20+
*/
1321
function opcache_get_configuration(): array|false {}
1422

1523
function opcache_is_script_cached(string $filename): bool {}

ext/opcache/opcache_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: 919d85eb3f3e1127ea3911051f1d98340e84654e */
2+
* Stub hash: 81f337ea4ac5361ca4a0873fcd3b033beaf524c6 */
33

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

ext/pdo/pdo.stub.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@ class PDOException extends RuntimeException
77
public ?array $errorInfo = null;
88
}
99

10+
/**
11+
* @return array<int, string>
12+
* @refcount 1
13+
*/
1014
function pdo_drivers(): array {}

ext/pdo/pdo_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: 5cb75e0f0869651dd616b11c3bd0d407deb3c6df */
2+
* Stub hash: 52ee252fdfc80d4d076f1c49842e333c27ed5102 */
33

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

0 commit comments

Comments
 (0)