|
35 | 35 | '__return_empty_array' => ['array{}'],
|
36 | 36 | '__return_empty_string' => ["''"],
|
37 | 37 | '__return_zero' => ['0'],
|
38 |
| - '_wp_json_sanity_check' => ['T', '@phpstan-template' => 'T', 'value' => 'T', 'depth' => 'positive-int'], |
| 38 | + '_wp_json_sanity_check' => ['T', '@phpstan-template' => 'T', 'value' => 'T', 'depth' => 'int<1, max>'], |
39 | 39 | '_get_list_table' => ["(\$class_name is 'WP_Posts_List_Table'|'WP_Media_List_Table'|'WP_Terms_List_Table'|'WP_Users_List_Table'|'WP_Comments_List_Table'|'WP_Post_Comments_List_Table'|'WP_Links_List_Table'|'WP_Plugin_Install_List_Table'|'WP_Themes_List_Table'|'WP_Theme_Install_List_Table'|'WP_Plugins_List_Table'|'WP_Application_Passwords_List_Table'|'WP_MS_Sites_List_Table'|'WP_MS_Users_List_Table'|'WP_MS_Themes_List_Table'|'WP_Privacy_Data_Export_Requests_List_Table'|'WP_Privacy_Data_Removal_Requests_List_Table' ? T : false)", '@phpstan-template' => 'T', 'class_name' => 'class-string<T>', 'args' => 'array{screen?: string}'],
|
40 |
| - 'absint' => ['($maybeint is T&non-negative-int ? T : ($maybeint is negative-int ? positive-int : ($maybeint is empty ? 0 : ($maybeint is numeric-string ? non-negative-int : ($maybeint is string ? 0 : ($maybeint is true|non-empty-array ? 1 : ($maybeint is bool ? 0|1 : non-negative-int)))))))', '@phpstan-template T' => 'of int', 'maybeint' => 'T|scalar|array|resource|null'], |
| 40 | + 'absint' => ['($maybeint is T&int<0, max> ? T : ($maybeint is int<min, -1> ? int<1, max> : ($maybeint is empty ? 0 : ($maybeint is numeric-string ? int<0, max> : ($maybeint is string ? 0 : ($maybeint is true|non-empty-array ? 1 : ($maybeint is bool ? 0|1 : int<0, max>)))))))', '@phpstan-template T' => 'of int', 'maybeint' => 'T|scalar|array|resource|null'], |
41 | 41 | 'addslashes_gpc' => ['T', '@phpstan-template' => 'T', 'gpc' => 'T'],
|
42 | 42 | 'add_submenu_page' => [null, 'callback' => "''|callable"],
|
43 | 43 | 'bool_from_yn' => ["(\$yn is 'y' ? true : false)"],
|
|
55 | 55 | 'validate_file' => ["(\$file is '' ? 0 : (\$allowed_files is empty ? 0|1|2 : 0|1|2|3))"],
|
56 | 56 | 'wp_die' => ['($args is array{exit: false}&array ? void : never)'],
|
57 | 57 | 'wp_dropdown_languages' => ["(\$args is array{id: null|''}&array ? void : (\$args is array{name: null|''}&array ? void : string))"],
|
58 |
| - 'wp_clear_scheduled_hook' => ['(0|positive-int|($wp_error is false ? false : \WP_Error))', 'args' => $cronArgsType], |
| 58 | + 'wp_clear_scheduled_hook' => ['(0|int<1, max>|($wp_error is false ? false : \WP_Error))', 'args' => $cronArgsType], |
59 | 59 | 'wp_generate_tag_cloud' => ["(\$args is array{format: 'array'}&array ? array<int, string> : string)"],
|
60 | 60 | 'wp_get_schedule' => [null, 'args' => $cronArgsType],
|
61 | 61 | 'wp_get_scheduled_event' => [null, 'args' => $cronArgsType],
|
|
147 | 147 | 'term_exists' => ["(\$term is 0 ? 0 : (\$term is '' ? null : (\$taxonomy is '' ? string|null : array{term_id: string, term_taxonomy_id: string}|null)))"],
|
148 | 148 | 'is_term' => ["(\$term is 0 ? 0 : (\$term is '' ? null : (\$taxonomy is '' ? string|null : array{term_id: string, term_taxonomy_id: string}|null)))"],
|
149 | 149 | 'tag_exists' => ["(\$tag_name is 0 ? 0 : (\$tag_name is '' ? null : array{term_id: string, term_taxonomy_id: string}|null))"],
|
150 |
| - 'wp_insert_link' => ['($wp_error is false ? 0|positive-int : positive-int|\WP_Error)'], |
151 |
| - 'wp_insert_category' => ['($wp_error is false ? 0|positive-int : positive-int|\WP_Error)'], |
152 |
| - 'wp_insert_post' => ['($wp_error is false ? 0|positive-int : positive-int|\WP_Error)'], |
153 |
| - 'wp_insert_attachment' => ['($wp_error is false ? 0|positive-int : positive-int|\WP_Error)'], |
154 |
| - 'wp_update_post' => ['($wp_error is false ? 0|positive-int : positive-int|\WP_Error)'], |
155 |
| - 'wp_unschedule_hook' => ['($wp_error is false ? 0|positive-int|false : 0|positive-int|\WP_Error)'], |
| 150 | + 'wp_insert_link' => ['($wp_error is false ? 0|int<1, max> : int<1, max>|\WP_Error)'], |
| 151 | + 'wp_insert_category' => ['($wp_error is false ? 0|int<1, max> : int<1, max>|\WP_Error)'], |
| 152 | + 'wp_insert_post' => ['($wp_error is false ? 0|int<1, max> : int<1, max>|\WP_Error)'], |
| 153 | + 'wp_insert_attachment' => ['($wp_error is false ? 0|int<1, max> : int<1, max>|\WP_Error)'], |
| 154 | + 'wp_update_post' => ['($wp_error is false ? 0|int<1, max> : int<1, max>|\WP_Error)'], |
| 155 | + 'wp_unschedule_hook' => ['($wp_error is false ? 0|int<1, max>|false : 0|int<1, max>|\WP_Error)'], |
156 | 156 | 'wp_update_comment' => ['($wp_error is false ? 0|1|false : 0|1|\WP_Error)'],
|
157 | 157 | 'wp_set_comment_status' => ['($wp_error is false ? bool : true|\WP_Error)'],
|
158 | 158 | 'comment_class' => ['($display is true ? void : string)'],
|
|
179 | 179 | 'WP_Filesystem_SSH2::dirlist' => [$filesystemDirlistReturnType],
|
180 | 180 | 'WP_Filesystem_ftpsockets::dirlist' => [$filesystemDirlistReturnType],
|
181 | 181 | 'wpdb::prepare' => [null, 'query' => 'literal-string'],
|
182 |
| - 'wpdb::get_row' => ["null|void|(\$output is 'ARRAY_A' ? array<array-key, mixed> : (\$output is 'ARRAY_N' ? list<mixed> : \stdClass))", 'output' => "'OBJECT'|'ARRAY_A'|'ARRAY_N'", 'y' => '0|positive-int'], |
| 182 | + 'wpdb::get_row' => ["null|void|(\$output is 'ARRAY_A' ? array<array-key, mixed> : (\$output is 'ARRAY_N' ? list<mixed> : \stdClass))", 'output' => "'OBJECT'|'ARRAY_A'|'ARRAY_N'", 'y' => '0|int<1, max>'], |
183 | 183 | 'wpdb::get_results' => ["null|(\$output is 'ARRAY_A' ? list<array<array-key, mixed>> : (\$output is 'ARRAY_N' ? list<array<int, mixed>> : (\$output is 'OBJECT_K' ? array<array-key, \stdClass> : list<\stdClass>)))", 'output' => "'OBJECT'|'OBJECT_K'|'ARRAY_A'|'ARRAY_N'"],
|
184 | 184 | 'get_bookmark' => ["null|(\$output is 'ARRAY_A' ? array<string, mixed> : (\$output is 'ARRAY_N' ? array<int, mixed> : \stdClass))", 'output' => "'OBJECT'|'ARRAY_A'|'ARRAY_N'"],
|
185 | 185 | 'get_categories' => ["(\$args is array{fields: 'count'}&array ? list<numeric-string> : (\$args is array{fields: 'names'|'slugs'}&array ? list<string> : (\$args is array{fields: 'id=>name'|'id=>slug'}&array ? array<int, string> : (\$args is array{fields: 'id=>parent'}&array ? array<int, int> : (\$args is array{fields: 'ids'|'tt_ids'}&array ? list<int> : array<int, \WP_Term>)))))"],
|
|
198 | 198 | 'wp_get_post_tags' => ["(\$post_id is 0 ? array{} : ((\$args is array{fields: 'names'|'slugs'}&array ? list<string> : (\$args is array{fields: 'id=>name'|'id=>slug'}&array ? array<int, string> : (\$args is array{fields: 'id=>parent'}&array ? array<int, int> : (\$args is array{fields: 'ids'|'tt_ids'}&array ? list<int> : (\$args is array{fields: 'count'}&array ? numeric-string : array<int, \WP_Term>)))))|\WP_Error))"],
|
199 | 199 | 'wp_get_post_terms' => ["(\$post_id is 0 ? array{} : (\$taxonomy is empty ? array{} : ((\$args is array{fields: 'names'|'slugs'}&array ? list<string> : (\$args is array{fields: 'id=>name'|'id=>slug'}&array ? array<int, string> : (\$args is array{fields: 'id=>parent'}&array ? array<int, int> : (\$args is array{fields: 'ids'|'tt_ids'}&array ? list<int> : (\$args is array{fields: 'count'}&array ? numeric-string : array<int, \WP_Term>)))))|\WP_Error)))"],
|
200 | 200 | 'wp_get_object_terms' => ["(\$object_ids is empty ? array{} : (\$taxonomies is empty ? array{} : ((\$args is array{fields: 'names'|'slugs'}&array ? list<string> : (\$args is array{fields: 'id=>name'|'id=>slug'}&array ? array<int, string> : (\$args is array{fields: 'id=>parent'}&array ? array<int, int> : (\$args is array{fields: 'ids'|'tt_ids'}&array ? list<int> : (\$args is array{fields: 'count'}&array ? numeric-string : array<int, \WP_Term>)))))|\WP_Error)))"],
|
201 |
| - 'wp_json_encode' => ['non-empty-string|false', 'depth' => 'positive-int'], |
| 201 | + 'wp_json_encode' => ['non-empty-string|false', 'depth' => 'int<1, max>'], |
202 | 202 | 'wp_parse_list' => ['($input_list is array ? array<scalar> : list<string>)'],
|
203 | 203 | 'wp_parse_str' => [null, '@phpstan-param-out' => 'array<int|string, array|string> $result'],
|
204 |
| - 'size_format' => ["(\$bytes is not numeric ? false : (\$bytes is negative-int|'0' ? false : string))"], |
| 204 | + 'size_format' => ["(\$bytes is not numeric ? false : (\$bytes is int<min, -1>|'0' ? false : string))"], |
205 | 205 | 'WP_Translations::translate' => ['($singular is null ? null : string)'],
|
206 | 206 | 'WP_Translations::translate_plural' => ['($singular is null ? null : ($plural is null ? T : string))', '@phpstan-template T' => 'of string|null', 'singular' => 'T', 'count' => 'int'],
|
207 | 207 | 'WP_Query' => [null, '@phpstan-property-read bool $query_vars_changed' => '', '@phpstan-property-read bool|string $query_vars_hash' => '', '@phpstan-method void init_query_flags()' => ''],
|
208 | 208 | 'WP_Widget_Factory::$widgets' => [null, '@phpstan-var' => 'array<string, \WP_Widget>'],
|
209 | 209 | 'WP_Widget_Factory::register' => [null, 'widget' => 'class-string<\WP_Widget>|\WP_Widget'],
|
210 | 210 | 'WP_Widget_Factory::unregister' => [null, 'widget' => 'class-string<\WP_Widget>|\WP_Widget'],
|
211 | 211 | 'Custom_Image_Header::show_header_selector' => [null, 'type' => "'default'|'uploaded'"],
|
212 |
| - 'Custom_Image_Header::set_header_image' => [null, 'choice' => 'string|array{attachment_id: positive-int, url: string, width: non-negative-int, height: non-negative-int}'], |
| 212 | + 'Custom_Image_Header::set_header_image' => [null, 'choice' => 'string|array{attachment_id: int<1, max>, url: string, width: int<0, max>, height: int<0, max>}'], |
213 | 213 | ];
|
0 commit comments