-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathfunctionMap.php
More file actions
431 lines (427 loc) · 39.7 KB
/
functionMap.php
File metadata and controls
431 lines (427 loc) · 39.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
<?php
declare(strict_types=1);
$httpReturnType = 'array{headers: \WpOrg\Requests\Utility\CaseInsensitiveDictionary, body: string, response: array{code: int, message: string}, cookies: array<int, \WP_Http_Cookie>, filename: string|null, http_response: \WP_HTTP_Requests_Response}|\WP_Error';
if (file_exists(sprintf('%s/source/wordpress/wp-includes/Requests/Cookie/Jar.php', __DIR__))) {
$httpReturnType = 'array{headers: \Requests_Utility_CaseInsensitiveDictionary, body: string, response: array{code: int,message: string}, cookies: array<int, \WP_Http_Cookie>, filename: string|null, http_response: \WP_HTTP_Requests_Response}|\WP_Error';
}
$cronArgsType = 'list<mixed>';
$wpWidgetRssFormArgsType = 'array{number: int, error: bool, title?: string, url?: string, items?: int, show_summary?: int, show_author?: int, show_date?: int}';
$wpWidgetRssFormInputsType = 'array{title?: bool, url?: bool, items?: bool, show_summary?: bool, show_author?: bool, show_date?: bool}';
$filesystemDirlistReturnType = "false|array<string, array{name: string, perms: string, permsn: string, owner: string|false, size: int|string|false, lastmodunix: int|string|false, lastmod: string|false, time: string|false, type: 'f'|'d'|'l', group: string|false, number: int|string|false, files?: array|false}>";
/**
* This array follows a format similar to PHPStan’s function map:
*
* '<function_name>' => ['<return_type>', '<arg_name>' => '<arg_type>']
*
* For classes, or if you don't wish to define the `@phpstan-return` tag:
* '<class_name>' => [null, '<arg_name>' => '<arg_type>']
*
* For class methods:
* '<class_name::method_name>' => ['<return_type>', '<arg_name>' => '<arg_type>']
*
* For class properties:
* '<class_name::$property_name>' => [null, '@phpstan-var' => '<property_type>']
*
* To add PHPStan tags, include them in the function/class/method/property entry
* as additional key–value pairs, for example:
* - '@phpstan-template <TemplateName>' => 'of <type_constraint>'
* - '@phpstan-implements <InterfaceName<TemplateTypes>>' => ''
* - '@phpstan-extends <ClassName<TemplateTypes>>' => ''
* - '@phpstan-type <TypeName> = <type_definition>' => ''
* - '@phpstan-property-read <property_type> $<property_name>' => ''
* - '@phpstan-assert-if-true =<type> $<var_name>' => ''
* - '@phpstan-[im]pure' => '' // for [im]pure functions
* Always prefix these keys with `@phpstan-`, and ensure the keys are unique to
* avoid overwriting entries.
*
* @link https://github.com/phpstan/phpstan-src/blob/2.1.x/resources/functionMap.php
*/
return [
// Functions
'__return_empty_array' => ['array{}'],
'__return_empty_string' => ["''"],
'__return_zero' => ['0'],
'_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' ? new<T> : false)", '@phpstan-template T' => 'of string', 'class_name' => 'T', 'args' => 'array{screen?: string}'],
'_load_remote_block_patterns' => [null, 'deprecated' => 'null'],
'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', '@phpstan-pure' => ''],
'_wp_post_revision_fields' => [null, 'deprecated' => 'false'],
'add_comments_page' => [null, 'callback' => "''|callable"],
'add_dashboard_page' => [null, 'callback' => "''|callable"],
'add_feed' => ['non-falsy-string', 'callback' => 'callable(bool, string): void'],
'add_link' => ['int<0, max>'],
'add_links_page' => [null, 'callback' => "''|callable"],
'add_management_page' => [null, 'callback' => "''|callable"],
'add_media_page' => [null, 'callback' => "''|callable"],
'add_menu_page' => [null, 'callback' => "''|callable"],
'add_option' => [null, 'deprecated' => "''"],
'add_options_page' => [null, 'callback' => "''|callable"],
'add_pages_page' => [null, 'callback' => "''|callable"],
'add_plugins_page' => [null, 'callback' => "''|callable"],
'add_posts_page' => [null, 'callback' => "''|callable"],
'add_shortcode' => ['void', 'tag' => 'non-empty-string', 'callback' => 'callable(array<string>, string|null, string): string'],
'add_submenu_page' => [null, 'callback' => "''|callable"],
'add_theme_page' => [null, 'callback' => "''|callable"],
'add_users_page' => [null, 'callback' => "''|callable"],
'addslashes_gpc' => ['($gpc is string ? string : array)', '@phpstan-pure' => ''],
'antispambot' => [null, 'hex_encoding' => '0|1'],
'apply_filters' => [null, 'hook_name' => 'non-empty-string'],
'apply_filters_ref_array' => [null, 'hook_name' => 'non-empty-string'],
'apply_filters_deprecated' => [null, 'hook_name' => 'non-empty-string'],
'backslashit' => [null, '@phpstan-pure' => ''],
'block_core_home_link_build_css_colors' => ['array{css_classes: list<string>, inline_styles: string}'],
'block_core_home_link_build_css_font_sizes' => ['array{css_classes: list<string>, inline_styles: string}'],
'block_core_navigation_build_css_colors' => ['array{css_classes: list<string>, inline_styles: string, overlay_css_classes: list<string>, overlay_inline_styles: string}'],
'block_core_navigation_build_css_font_sizes' => ['array{css_classes: list<string>, inline_styles: string}'],
'block_core_navigation_link_build_css_colors' => ['array{css_classes: list<string>, inline_styles: string}'],
'block_core_navigation_link_build_css_font_sizes' => ['array{css_classes: list<string>, inline_styles: string}'],
'block_core_navigation_link_render_submenu_icon' => ['non-falsy-string'],
'block_core_navigation_render_submenu_icon' => ['non-falsy-string'],
'block_core_navigation_submenu_build_css_font_sizes' => ['array{css_classes: list<string>, inline_styles: string}'],
'block_core_navigation_submenu_render_submenu_icon' => ['non-falsy-string'],
'block_core_page_list_build_css_colors' => ['array{css_classes: list<string>, inline_styles: string, overlay_css_classes: list<string>, overlay_inline_styles: string}'],
'block_core_page_list_build_css_font_sizes' => ['array{css_classes: list<string>, inline_styles: string}'],
'block_core_post_time_to_read_word_count' => ['int<0, max>'],
'block_version' => ["(\$content is '' ? 0 : 0|1)", '@phpstan-pure' => ''],
'bool_from_yn' => ["(\$yn is 'y' ? true : false)", '@phpstan-pure' => ''],
'build_dropdown_script_block_core_categories' => ['non-falsy-string'],
'check_admin_referer' => ['1|2|false', 'action' => 'string'],
'check_ajax_referer' => ['1|2|false', 'action' => 'string'],
'comment_class' => ['($display is true ? void : string)'],
'comments_link' => [null, 'deprecated' => "''", 'deprecated_2' => "''"],
'convert_chars' => [null, 'deprecated' => "''"],
'current_action' => ['non-empty-string|false'],
'current_filter' => ['non-empty-string|false'],
'current_time' => ["(\$type is 'timestamp'|'U' ? int : string)"],
'delete_plugins' => ['($plugins is empty ? false : true|null|WP_Error)', 'deprecated' => "''"],
'did_action' => ['int<0, max>'],
'did_filter' => ['int<0, max>'],
'discover_pingback_server_uri' => [null, 'deprecated' => "''"],
'do_action' => ['void', 'hook_name' => 'non-empty-string'],
'do_action_ref_array' => ['void', 'hook_name' => 'non-empty-string'],
'do_action_deprecated' => ['void', 'hook_name' => 'non-empty-string'],
'do_meta_boxes' => ['int<0, max>'],
'edit_link' => ['int<0, max>'],
'edit_term_link' => ['($display is true ? void : string|void)'],
'get_approved_comments' => ["(\$args is array{count: true}&array ? int : (\$args is array{fields: 'ids'}&array ? array<int, int> : array<int, \WP_Comment>))"],
'get_attachment_taxonomies' => ["(\$output is 'names' ? array<int, string> : array<string, \WP_Taxonomy>)"],
'get_available_post_statuses' => ['list<string>'],
'get_block_wrapper_attributes' => ['($extra_attributes is empty ? string : non-falsy-string)', 'extra_attributes' => 'array<string, string>'],
'get_bookmark' => ["null|(\$output is 'ARRAY_A' ? array<string, mixed> : (\$output is 'ARRAY_N' ? array<int, mixed> : \stdClass))", 'output' => "'OBJECT'|'ARRAY_A'|'ARRAY_N'"],
'get_bookmark_field' => ['array<int, int<1, max>>|int|string|\WP_Error', 'field' => "'link_id'|'link_url'|'link_name'|'link_image'|'link_target'|'link_description'|'link_visible'|'link_owner'|'link_rating'|'link_updated'|'link_rel'|'link_notes'|'link_rss'|'link_category'"],
'get_calendar' => ['($args is array{display: false}&array ? string : void)'],
'get_category_parents' => [null, 'deprecated' => 'array{}'],
'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>)))))"],
'get_category' => ["(\$category is object ? array<array-key, mixed>|\WP_Term : array<array-key, mixed>|\WP_Term|\WP_Error|null) & (\$output is 'ARRAY_A' ? array<string, mixed>|\WP_Error|null : (\$output is 'ARRAY_N' ? array<int, mixed>|\WP_Error|null : \WP_Term|\WP_Error|null))", 'output' => "'OBJECT'|'ARRAY_A'|'ARRAY_N'"],
'get_category_by_path' => ["(\$output is 'ARRAY_A' ? array<string, mixed>|\WP_Error|null : (\$output is 'ARRAY_N' ? array<int, mixed>|\WP_Error|null : \WP_Term|\WP_Error|null))", 'output' => "'OBJECT'|'ARRAY_A'|'ARRAY_N'"],
'get_comment' => ["(\$comment is \WP_Comment ? array<array-key, mixed>|\WP_Comment : array<array-key, mixed>|\WP_Comment|null) & (\$output is 'ARRAY_A' ? array<string, mixed>|null : (\$output is 'ARRAY_N' ? array<int, mixed>|null : \WP_Comment|null))", 'output' => "'OBJECT'|'ARRAY_A'|'ARRAY_N'"],
'get_comments_pagination_arrow' => ['non-falsy-string|null'],
'get_compat_media_markup' => ['array{item: string, meta: string}'],
'get_current_blog_id' => ['int<0, max>'],
'get_current_user_id' => ['int<0, max>'],
'get_default_link_to_edit' => ["object{link_url: string, link_name: string, link_visible: 'Y'}&\stdClass", '@phpstan-impure' => ''],
'get_delete_post_link' => [null, 'deprecated' => "''"],
'get_html_split_regex' => ['non-falsy-string', '@phpstan-pure' => ''],
'get_last_updated' => [null, 'deprecated' => "''"],
'get_media_item' => ['non-falsy-string'],
'get_object_taxonomies' => ["(\$output is 'names' ? array<int, string> : array<string, \WP_Taxonomy>)"],
'get_page_by_path' => ["(\$output is 'ARRAY_A' ? array<string, mixed>|null : (\$output is 'ARRAY_N' ? array<int, mixed>|null : \WP_Post|null))"],
'get_password_reset_key' => [null, '@phpstan-impure' => ''],
'get_permalink' => ['($post is \WP_Post ? string : string|false)'],
'get_post' => ["(\$post is \WP_Post ? array<array-key, mixed>|\WP_Post : array<array-key, mixed>|\WP_Post|null) & (\$output is 'ARRAY_A' ? array<string, mixed>|null : (\$output is 'ARRAY_N' ? array<int, mixed>|null : \WP_Post|null))", 'output' => "'OBJECT'|'ARRAY_A'|'ARRAY_N'" ],
'get_post_ancestors' => ['list<int>'],
'get_post_permalink' => ['($post is \WP_Post ? string : string|false)'],
'get_post_stati' => ["(\$output is 'names' ? array<string, string> : array<string, \stdClass>)"],
'get_post_types' => ["(\$output is 'names' ? array<string, string> : array<string, \WP_Post_Type>)"],
'get_posts' => ["(\$args is array{fields: 'id=>parent'|'ids'}&array ? array<int, int> : array<int, \WP_Post>)"],
'get_plugin_page_hookname' => ['non-falsy-string'],
'get_query_pagination_arrow' => ['non-falsy-string|null'],
'get_shortcode_regex' => ['non-falsy-string'],
'get_shortcode_atts_regex' => ['non-falsy-string', '@phpstan-pure' => ''],
'get_shortcode_tags_in_content' => ['list<non-empty-string>'],
'get_site_option' => [null, 'deprecated' => 'true'],
'get_site_screen_help_tab_args' => ["array{id: 'overview', title: string, content: non-falsy-string}"],
'get_site_screen_help_sidebar_content' => ['non-falsy-string'],
'get_sites' => ["(\$args is array{count: true}&array ? int : (\$args is array{fields: 'ids'}&array ? array<int, int> : array<int, \WP_Site>))"],
'get_submit_button' => ['non-falsy-string'],
'get_tag_regex' => ['non-falsy-string'],
'get_tags' => ["(\$args is array{fields: 'count'}&array ? 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>)))))|\WP_Error"],
'get_taxonomies' => ["(\$output is 'names' ? array<int, string> : array<int, \WP_Taxonomy>)"],
'get_taxonomies_for_attachments' => ["(\$output is 'names' ? array<int, string> : array<string, \WP_Taxonomy>)"],
'get_term' => ["(\$output is 'ARRAY_A' ? array<string, string|int>|\WP_Error|null : (\$output is 'ARRAY_N' ? list<string|int>|\WP_Error|null : \WP_Term|\WP_Error|null))", 'output' => "'OBJECT'|'ARRAY_A'|'ARRAY_N'"],
'get_term_by' => ["false|(\$output is 'ARRAY_A' ? array<string, string|int> : (\$output is 'ARRAY_N' ? list<string|int> : \WP_Term))"],
'get_terms' => ["(\$args is array{fields: 'count'}&array ? 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>)))))|\WP_Error", 'deprecated' => "''"],
'get_the_author' => [null, 'deprecated' => "''"],
'get_the_permalink' => ['($post is \WP_Post ? string : string|false)'],
'get_user' => ['($user_id is int<min, 0> ? false : \WP_User|false)'],
'get_user_by' => ["(\$field is 'id'|'ID' ? (\$value is int<min, 0> ? false : \WP_User|false) : \WP_User|false)"],
'get_user_option' => [null, 'deprecated' => "''"],
'get_wp_title_rss' => [null, 'deprecated' => "'–'"],
'has_action' => ['($callback is false ? bool : false|int)'],
'has_filter' => ['($callback is false ? bool : false|int)'],
'has_shortcode' => ['($tag is empty ? false : ($content is empty ? false : bool))', '@phpstan-assert-if-true =non-falsy-string $content' => '', '@phpstan-assert-if-true =non-empty-string $tag' => ''],
'have_posts' => [null, '@phpstan-impure' => ''],
'iframe_header' => [null, 'deprecated' => 'false'],
'image_link_input_fields' => ['non-falsy-string'],
'image_size_input_fields' => ["array{label: string, input: 'html', html: string}"],
'inject_ignored_hooked_blocks_metadata_attributes' => [null, 'deprecated' => 'null'],
'install_search_form' => [null, 'deprecated' => 'true'],
'is_email' => [null, 'deprecated' => 'false'],
'is_new_day' => ['0|1'],
'is_term' => ["(\$term is 0 ? 0 : (\$term is '' ? null : (\$taxonomy is '' ? string|null : array{term_id: string, term_taxonomy_id: string}|null)))"],
'is_wp_error' => ['($thing is \WP_Error ? true : false)', '@phpstan-assert-if-true' => '\WP_Error $thing'],
'load_plugin_textdomain' => [null, 'deprecated' => 'false'],
'maybe_serialize' => ['(T is array|object|string ? string : T)', '@phpstan-template T' => 'of mixed', 'data' => 'T'],
'mysql2date' => ["(\$format is 'G'|'U' ? int|false : string|false)"],
'newblog_notify_siteadmin' => [null, 'deprecated' => "''"],
'next_posts' => ['($display is true ? void : string)'],
'paginate_links' => ["(\$args is array{total: int<min, 1>}&array ? void : (\$args is array{type: 'array'}&array ? list<string> : string))"],
'post_type_archive_title' => ['($display is true ? void : string|void)'],
'prep_atom_text_construct' => ["array{'html'|'text'|'xhtml', string}"],
'previous_posts' => ['($display is true ? void : string)'],
'rawurlencode_deep' => ['T', '@phpstan-template T' => '', 'value' => 'T'],
'redirect_this_site' => [null, 'deprecated' => "''"],
'register_activation_hook' => ['void', 'callback' => 'callable(bool): void'],
'register_deactivation_hook' => ['void', 'callback' => 'callable(bool): void'],
'register_meta' => [null, 'deprecated' => 'null'],
'register_nav_menus' => [null, 'locations' => 'array<string, string>'],
'register_post_type' => [null, 'post_type' => 'lowercase-string&non-empty-string'],
'register_rest_route' => [null, 'route_namespace' => 'non-falsy-string', 'route' => 'non-falsy-string'],
'register_uninstall_hook' => ['void', 'callback' => 'callable(): void'],
'register_widget' => ['void', 'widget' => 'class-string<\WP_Widget>|\WP_Widget'],
'render_block_core_archives' => ['non-falsy-string'],
'render_block_core_categories' => ['non-falsy-string'],
'render_block_core_latest_comments' => ['non-falsy-string'],
'render_block_core_latest_posts' => ['non-falsy-string'],
'render_block_core_loginout' => ['non-falsy-string'],
'render_block_core_query_total' => ['non-falsy-string'],
'render_block_core_rss' => ['non-falsy-string'],
'render_block_core_search' => ['non-falsy-string'],
'render_block_core_site_logo' => ['non-falsy-string'],
'render_block_core_widget_group' => ['non-falsy-string'],
'rest_authorization_required_code' => ['401|403'],
'rest_sanitize_boolean' => ["(T is bool ? T : (T is ''|'false'|'FALSE'|'0'|0 ? false : true))", '@phpstan-template T' => 'of bool|string|int', 'value' => 'T', '@phpstan-pure' => ''],
'rest_ensure_response' => ['($response is \WP_Error ? \WP_Error : \WP_REST_Response)'],
'safecss_filter_attr' => [null, 'deprecated' => "''"],
'sanitize_bookmark_field' => ['array<int, int>|int|string', 'field' => "'link_id'|'link_url'|'link_name'|'link_image'|'link_target'|'link_description'|'link_visible'|'link_owner'|'link_rating'|'link_updated'|'link_rel'|'link_notes'|'link_rss'|'link_category'"],
'sanitize_category' => ['T', '@phpstan-template T' => 'of array|object', 'category' => 'T'],
'sanitize_post' => ['(T is \WP_Post ? \WP_Post : (T is object ? object : (T is array ? array : T)))', '@phpstan-template T' => 'of mixed', 'post' => 'T'],
'sanitize_post_field' => ["(\$field is 'ID'|'post_parent'|'menu_order' ? (T is int ? T : int) : (\$field is 'ancestors' ? (T is array<int<0, max>>|list<int<0, max>> ? T : (T is list ? list<int<0, max>> : array<int<0, max>>)) : (\$context is 'raw' ? T : (\$context is 'attribute'|'js' ? string : (\$context is 'edit' ? (\$field is not 'post_content' ? string : mixed) : mixed)))))", '@phpstan-template T' => 'of mixed', 'value' => 'T'],
'sanitize_sql_orderby' => ['(T is non-falsy-string ? T|false : false)', '@phpstan-template T' => 'of string', 'orderby' => 'T'],
'sanitize_term' => ['T', '@phpstan-template T' => 'of array|object', 'term' => 'T'],
'sanitize_term_field' => ["(\$field is 'parent'|'term_id'|'count'|'term_group'|'term_taxonomy_id'|'object_id' ? int<0, max> : (\$context is 'raw' ? T : (\$context is 'attribute'|'edit'|'js' ? string : mixed)))", '@phpstan-template T' => 'of string', 'value' => 'T'],
'sanitize_title_with_dashes' => ['lowercase-string', 'context' => "'display'|'save'"],
'shortcode_exists' => [null, '@phpstan-assert-if-true =non-empty-string $tag' => ''],
'single_cat_title' => ['($display is true ? void : string|void)'],
'single_month_title' => ['($display is true ? false|void : false|string)'],
'single_post_title' => ['($display is true ? void : string|void)'],
'single_tag_title' => ['($display is true ? void : string|void)'],
'single_term_title' => ['($display is true ? void : string|void)'],
'size_format' => ["(\$bytes is not numeric ? false : (\$bytes is int<min, -1>|'0' ? false : string))"],
'stripslashes_deep' => ['T', '@phpstan-template T' => '', 'value' => 'T'],
'stripslashes_from_strings_only' => ["(\$value is string ? (\$value is '' ? '' : string) : T)", '@phpstan-template T' => '', 'value' => 'T|string', '@phpstan-pure' => ''],
'switch_to_blog' => [null, 'deprecated' => 'null'],
'tag_exists' => ["(\$tag_name is 0 ? 0 : (\$tag_name is '' ? null : array{term_id: string, term_taxonomy_id: string}|null))"],
'taxonomy_exists' => ['($taxonomy is non-falsy-string ? bool : false)', '@phpstan-assert-if-true' => '=non-falsy-string $taxonomy'],
'term_exists' => ["(\$term is 0 ? 0 : (\$term is '' ? null : (\$taxonomy is '' ? string|null : array{term_id: string, term_taxonomy_id: string}|null)))"],
'the_attachment_link' => [null, 'deprecated' => 'false'],
'the_author' => [null, 'deprecated' => "''", 'deprecated_echo' => 'true'],
'the_author_posts_link' => [null, 'deprecated' => "''"],
'the_date' => ['($display is true ? void : string)'],
'the_modified_date' => ['($display is true ? void : string)'],
'the_title' => ['($display is true ? void : string|void)'],
'trackback_rdf' => [null, 'deprecated' => "''"],
'trackback_url' => [null, 'deprecated_echo' => 'true'],
'trailingslashit' => ['non-falsy-string', '@phpstan-pure' => ''],
'unregister_setting' => [null, 'deprecated' => "''"],
'untrailingslashit' => [null, '@phpstan-pure' => ''],
'update_blog_option' => [null, 'deprecated' => 'null'],
'update_posts_count' => [null, 'deprecated' => "''"],
'urldecode_deep' => ['T', '@phpstan-template T' => '', 'value' => 'T'],
'urlencode_deep' => ['T', '@phpstan-template T' => '', 'value' => 'T'],
'validate_file' => ["(\$file is '' ? 0 : (\$allowed_files is empty ? 0|1|2 : 0|1|2|3))"],
'validate_plugin' => ['($plugin is empty ? \WP_Error : 0|\WP_Error)'],
'wp_caption_input_textarea' => ['non-falsy-string'],
'wp_clear_scheduled_hook' => ['(int<0, max>|($wp_error is false ? false : \WP_Error))', 'args' => $cronArgsType],
'wp_count_terms' => ['numeric-string|\WP_Error', 'deprecated' => "''"],
'wp_create_nonce' => ['lowercase-string&non-falsy-string', 'action' => '-1|string'],
'wp_debug_backtrace_summary' => ['($pretty is true ? string : list<string>)'],
'wp_die' => ['($args is array{exit: false}&array ? void : never)'],
'wp_dropdown_languages' => ["(\$args is array{id: null|''}&array ? void : (\$args is array{name: null|''}&array ? void : string))"],
'wp_extract_urls' => ['($content is empty ? array{} : list<string>)'],
'wp_fast_hash' => ['non-falsy-string'],
'wp_generate_block_templates_export_file' => ['non-falsy-string|\WP_Error'],
'wp_generate_password' => [null, '@phpstan-impure' => ''],
'wp_generate_tag_cloud' => ["(\$args is array{format: 'array'}&array ? array<int, string> : string)"],
'wp_generate_uuid4' => ['lowercase-string&non-falsy-string', '@phpstan-impure' => ''],
'wp_get_archives' => ['($args is array{echo: false|0}&array ? string|void : void)'],
'wp_get_comment_status' => ["'approved'|'spam'|'trash'|'unapproved'|false"],
'wp_get_elements_class_name' => ['non-falsy-string'],
'wp_get_http_headers' => [null, 'deprecated' => 'false'],
'wp_get_inline_script_tag' => ['non-falsy-string', 'attributes' => 'array<string, string|true>'],
'wp_get_link_cats' => ['($link_id is empty ? array{} : array<int, int<1, max>>)'],
'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)))"],
'wp_get_post_categories' => ["(\$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: 'all'|'all_with_object_id'}&array ? array<int, \WP_Term> : (\$args is array{fields: 'count'}&array ? numeric-string : list<int>)))))|\WP_Error))"],
'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))"],
'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)))"],
'wp_get_schedule' => [null, 'args' => $cronArgsType],
'wp_get_scheduled_event' => [null, 'args' => $cronArgsType],
'wp_get_script_tag' => ['non-falsy-string', 'attributes' => 'array<string, string|true>'],
'wp_get_server_protocol' => ["'HTTP/1.0'|'HTTP/1.1'|'HTTP/2'|'HTTP/2.0'|'HTTP/3'"],
'wp_get_sidebars_widgets' => [null, 'deprecated' => 'true'],
'wp_get_speculation_rules_configuration' => ["array{mode: 'prefetch'|'prerender', eagerness: 'conservative'|'eager'|'moderate'}|null"],
'wp_get_typography_font_size_value' => [null, 'settings' => 'array'],
'wp_get_word_count_type' => ["'characters_excluding_spaces'|'characters_including_spaces'|'words'"],
'wp_get_wp_version' => ['non-falsy-string'],
'wp_hash' => ['lowercase-string&non-falsy-string', 'scheme' => "'auth'|'logged_in'|'nonce'|'secure_auth'"],
'wp_html_split' => ['non-empty-list<string>'],
'wp_http_validate_url' => ["(TUrl is numeric|'' ? false : TUrl|false)", '@phpstan-template TUrl' => 'of string', 'url' => 'TUrl'],
'wp_insert_attachment' => ['($wp_error is false ? int<0, max> : int<1, max>|\WP_Error)'],
'wp_insert_category' => ['($wp_error is false ? int<0, max> : int<1, max>|\WP_Error)'],
'wp_insert_link' => ['($wp_error is false ? int<0, max> : int<0, max>|\WP_Error)'],
'wp_insert_post' => ['($wp_error is false ? int<0, max> : int<1, max>|\WP_Error)'],
'wp_install' => [null, 'deprecated' => "''"],
'wp_internal_hosts' => ['array<lowercase-string>'],
'wp_is_numeric_array' => ['(T is array<int, mixed> ? true : false)', '@phpstan-template T' => 'of mixed', 'data' => 'T', '@phpstan-assert-if-true' => '(T is list ? T : array<int, mixed>) $data', '@phpstan-pure' => ''],
'wp_is_post_revision' => ['($post is \WP_Post ? false|int<0, max> : ($post is int<min, 0> ? false : false|int<0, max>))'],
'wp_is_uuid' => ['($version is 4|null ? bool : false)', 'uuid' => 'TUuid', 'version' => '4', '@phpstan-template TUuid' => 'of string', '@phpstan-assert-if-true' => '=TUuid&lowercase-string&non-falsy-string $uuid', '@phpstan-pure' => ''],
'wp_json_encode' => ['non-empty-string|false', 'depth' => 'int<1, max>'],
'wp_latest_comments_draft_or_post_title' => ['non-falsy-string'],
'wp_list_bookmarks' => ['($args is array{echo: false|0}&array ? string : void)'],
'wp_list_categories' => ['($args is array{echo: false|0}&array ? string|false : false|void)'],
'wp_list_pages' => ['($args is array{echo: false}&array ? string : void)'],
'wp_list_post_revisions' => ['void', 'type' => "'all'|'revision'|'autosave'"],
'wp_loginout' => ['($display is true ? void : string)'],
'wp_media_insert_url_form' => ['non-falsy-string'],
'wp_nav_menu_manage_columns' => ["array{_title: string, cb: '<input type=\"checkbox\" />', link-target: string, title-attribute: string, css-classes: string, xfn: string, description: string}"],
'wp_next_scheduled' => [null, 'args' => $cronArgsType],
'wp_nonce_field' => [null, 'action' => '-1|string'],
'wp_nonce_tick' => [null, 'action' => '-1|string', '@phpstan-impure' => ''],
'wp_nonce_url' => [null, 'action' => '-1|string'],
'wp_parse_list' => ['($input_list is array ? array<scalar> : list<string>)'],
'wp_parse_str' => [null, '@phpstan-param-out' => 'array<int|string, array|string> $result'],
'wp_rand' => [null, '@phpstan-impure' => ''],
'wp_register' => ['($display is true ? void : string)'],
'wp_register_ability' => [null, 'name' => 'lowercase-string&non-falsy-string'],
'wp_remote_get' => [$httpReturnType],
'wp_remote_head' => [$httpReturnType],
'wp_remote_post' => [$httpReturnType],
'wp_remote_request' => [$httpReturnType],
'wp_reschedule_event' => ['($wp_error is false ? bool : true|\WP_Error)', 'args' => $cronArgsType],
'wp_robots_max_image_preview_large' => ['array<string, bool|string>', 'robots' => 'array<string, bool|string>'],
'wp_robots_no_robots' => ['array<string, bool|string>', 'robots' => 'array<string, bool|string>'],
'wp_robots_noindex' => ['array<string, bool|string>', 'robots' => 'array<string, bool|string>'],
'wp_robots_noindex_embeds' => ['array<string, bool|string>', 'robots' => 'array<string, bool|string>'],
'wp_robots_noindex_search' => ['array<string, bool|string>', 'robots' => 'array<string, bool|string>'],
'wp_robots_sensitive_page' => ['array<string, bool|string>', 'robots' => 'array<string, bool|string>'],
'wp_safe_remote_get' => [$httpReturnType],
'wp_safe_remote_head' => [$httpReturnType],
'wp_safe_remote_post' => [$httpReturnType],
'wp_safe_remote_request' => [$httpReturnType],
'wp_schedule_event' => ['($wp_error is false ? bool : true|\WP_Error)', 'args' => $cronArgsType],
'wp_schedule_single_event' => ['($wp_error is false ? bool : true|\WP_Error)', 'args' => $cronArgsType],
'wp_scripts_get_suffix' => ["''|'.min'"],
'wp_set_comment_status' => ['($wp_error is false ? bool : true|\WP_Error)'],
'wp_slash' => ['($value is string ? string : array)', '@phpstan-pure' => ''],
'wp_tag_cloud' => ["(\$args is array{format: 'array'}&array ? array<int, string>|void : (\$args is array{echo: false|0}&array ? string|void : void))"],
'wp_title' => ['($display is true ? void : string)'],
'wp_title_rss' => [null, 'deprecated' => "'–'"],
'wp_trigger_error' => [null, 'error_level' => '\E_USER_ERROR|\E_USER_WARNING|\E_USER_NOTICE|\E_USER_DEPRECATED'],
'wp_unique_id' => ['($prefix is empty ? numeric-string : ($prefix is numeric ? numeric-string : string))&non-falsy-string', '@phpstan-impure' => ''],
'wp_unique_id_from_values' => ['($prefix is lowercase-string ? lowercase-string&non-falsy-string : non-falsy-string)', 'data' => 'non-empty-array'],
'wp_unique_prefixed_id' => ['($prefix is empty ? numeric-string : ($prefix is numeric ? numeric-string : string))&non-falsy-string', '@phpstan-impure' => ''],
'wp_unschedule_event' => ['($wp_error is false ? bool : true|\WP_Error)', 'args' => $cronArgsType],
'wp_unschedule_hook' => ['($wp_error is false ? int<0, max>|false : int<0, max>|\WP_Error)'],
'wp_unslash' => ['T', '@phpstan-template T' => '', 'value' => 'T'],
'wp_update_category' => ['int<0, max>|false'],
'wp_update_comment' => ['($wp_error is false ? 0|1|false : 0|1|\WP_Error)'],
'wp_update_link' => ['int<0, max>'],
'wp_update_post' => ['($wp_error is false ? int<0, max> : int<1, max>|\WP_Error)'],
'wp_upload_bits' => [null, 'name' => 'non-empty-string', 'deprecated' => 'null'],
'wp_verify_nonce' => ['1|2|false', 'action' => '-1|string'],
'wp_widget_rss_form' => ['void', 'args' => $wpWidgetRssFormArgsType, 'inputs' => $wpWidgetRssFormInputsType],
'wp_widget_rss_process' => ['array{title: string, url: string, link: string, items: int<1, 20>, error: string|false, show_summary: int, show_author: int, show_date: int}'],
'wp_widgets_access_body_class' => ['non-falsy-string'],
'xfn_check' => [null, 'deprecated' => "''"],
'zeroise' => ['($threshold is 0 ? lowercase-string&non-empty-string&numeric-string : ($number is int<0, max> ? lowercase-string&non-empty-string&numeric-string : lowercase-string&non-empty-string))', 'threshold' => 'int<0, max>'],
// Classes, methods, and properties
'Custom_Background::$admin_header_callback' => [null, '@phpstan-var' => "''|callable(): void"],
'Custom_Background::$admin_image_div_callback' => [null, '@phpstan-var' => "''|callable(): void"],
'Custom_Background::__construct' => [null, 'admin_header_callback' => "''|callable(): void", 'admin_image_div_callback' => "''|callable(): void"],
'Custom_Image_Header::$admin_header_callback' => [null, '@phpstan-var' => "''|callable(): void"],
'Custom_Image_Header::$admin_image_div_callback' => [null, '@phpstan-var' => "''|callable(): void"],
'Custom_Image_Header::__construct' => [null, 'admin_image_div_callback' => "''|callable(): void"],
'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>}'],
'Custom_Image_Header::show_header_selector' => [null, 'type' => "'default'|'uploaded'"],
'WP_Ajax_Response::add' => ['non-falsy-string'],
'WP_Block_List' => [null, '@phpstan-implements ArrayAccess<int, \WP_Block>' => ''],
'WP_Block_List::offsetExists' => [null, 'offset' => 'int'],
'WP_Block_List::offsetGet' => ['\WP_Block|null', 'offset' => 'int'],
'WP_Block_List::offsetSet' => ['void', 'offset' => 'int|null'],
'WP_Block_List::offsetUnset' => ['void', 'offset' => 'int'],
'WP_Object_Cache::delete' => [null, 'deprecated' => 'false'],
'WP_Dependencies::$groups' => [null, '@phpstan-var' => 'array<string, int|false>'],
'WP_Dependencies::get_etag' => ['non-falsy-string'],
'WP_Dependencies::query' => ["(\$handle is not non-empty-string ? false : (\$status is not TStatus ? false : (\$status is 'registered'|'scripts' ? _WP_Dependency|false : bool)))", '@phpstan-template TStatus' => "'registered'|'scripts'|'enqueued'|'queued'|'to_do'|'to_print'|'done'|'printed'"],
'WP_Filesystem_Base::dirlist' => [$filesystemDirlistReturnType],
'WP_Filesystem_Direct::dirlist' => [$filesystemDirlistReturnType],
'WP_Filesystem_FTPext::dirlist' => [$filesystemDirlistReturnType],
'WP_Filesystem_ftpsockets::dirlist' => [$filesystemDirlistReturnType],
'WP_Filesystem_SSH2::dirlist' => [$filesystemDirlistReturnType],
'WP_Http::get' => [$httpReturnType],
'WP_Http::head' => [$httpReturnType],
'WP_Http::post' => [$httpReturnType],
'WP_Http::request' => [$httpReturnType],
'WP_List_Table::set_pagination_args' => ['void', 'args' => 'array{total_items?: int, total_pages?: int, per_page?: int}'],
'WP_Locale::$word_count_type' => [null, '@phpstan-var' => "'characters_excluding_spaces'|'characters_including_spaces'|'words'"],
'WP_Locale::get_word_count_type' => ["'characters_excluding_spaces'|'characters_including_spaces'|'words'"],
'WP_Query' => [null, '@phpstan-property-read bool $query_vars_changed' => '', '@phpstan-property-read bool|string $query_vars_hash' => '', '@phpstan-method void init_query_flags()' => ''],
'WP_Query::have_posts' => [null, '@phpstan-impure' => ''],
'WP_REST_Request' => [null, '@phpstan-template T' => 'of array = array<string, mixed>', '@phpstan-implements ArrayAccess<key-of<T>, value-of<T>>' => ''],
'WP_REST_Request::get_param' => ['T[TOffset]|null', '@phpstan-template TOffset' => 'of key-of<T>', 'key' => 'TOffset'],
'WP_REST_Request::get_params' => ['T'],
'WP_REST_Request::has_param' => [null, 'key' => 'key-of<T>'],
'WP_REST_Request::offsetExists' => [null, 'offset' => 'key-of<T>'],
'WP_REST_Request::offsetGet' => ['T[TOffset]|null', '@phpstan-template TOffset' => 'of key-of<T>', 'offset' => 'TOffset'],
'WP_REST_Request::offsetSet' => ['void', '@phpstan-template TOffset' => 'of key-of<T>', 'offset' => 'TOffset', 'value' => 'T[TOffset]'],
'WP_REST_Request::offsetUnset' => ['void', '@phpstan-template TOffset' => 'of key-of<T>', 'offset' => 'TOffset'],
'WP_REST_Request::set_param' => ['void', '@phpstan-template TOffset' => 'of key-of<T>', 'key' => 'TOffset', 'value' => 'T[TOffset]'],
'WP_Theme' => [
null,
'@phpstan-type ThemeKey' => "'Name'|'Version'|'Status'|'Title'|'Author'|'Author Name'|'Author URI'|'Description'|'Template'|'Stylesheet'|'Template Files'|'Stylesheet Files'|'Template Dir'|'Stylesheet Dir'|'Screenshot'|'Tags'|'Theme Root'|'Theme Root URI'|'Parent Theme'",
'@phpstan-property-read string $name' => '',
'@phpstan-property-read string $title' => '',
'@phpstan-property-read string $version' => '',
'@phpstan-property-read string $parent_theme' => '',
'@phpstan-property-read string $template_dir' => '',
'@phpstan-property-read string $stylesheet_dir' => '',
'@phpstan-property-read string $template' => '',
'@phpstan-property-read string $stylesheet' => '',
'@phpstan-property-read string $screenshot' => '',
'@phpstan-property-read string $description' => '',
'@phpstan-property-read string $author' => '',
'@phpstan-property-read list<string> $tags' => '',
'@phpstan-property-read string $theme_root' => '',
'@phpstan-property-read string $theme_root_uri' => '',
],
'WP_Theme::get' => ["(\$header is 'Name'|'ThemeURI'|'Description'|'Author'|'AuthorURI'|'Version'|'Template'|'Status'|'Tags'|'TextDomain'|'DomainPath'|'RequiresWP'|'RequiresPHP'|'UpdateURI' ? (\$header is 'Tags' ? string[] : string) : false)"],
'WP_Theme::offsetExists' => ['($offset is ThemeKey ? true : false)'],
'WP_Theme::offsetGet' => ['($offset is ThemeKey ? mixed : null)'],
'WP_Theme_JSON_Resolver::get_theme_data' => [null, 'deprecated' => 'array{}'],
'WP_Translations::translate' => ['($singular is null ? null : string)'],
'WP_Translations::translate_plural' => ['($singular is null ? null : ($plural is null ? T : string))', '@phpstan-template T' => 'of string|null', 'singular' => 'T', 'count' => 'int'],
'WP_Widget' => [null, '@phpstan-template T' => 'of array = array<string, mixed>'],
'WP_Widget::display_callback' => [null, '@final' => ''],
'WP_Widget::form' => [null, 'instance' => 'T'],
'WP_Widget::form_callback' => [null, '@final' => ''],
'WP_Widget::get_field_id' => ['non-falsy-string'],
'WP_Widget::get_field_name' => ['non-falsy-string'],
'WP_Widget::update' => [null, 'new_instance' => 'T', 'old_instance' => 'T'],
'WP_Widget::update_callback' => [null, '@final' => '', 'deprecated' => '1'],
'WP_Widget::widget' => [null, 'instance' => 'T', 'args' => 'array{name:string,id:string,description:string,class:string,before_widget:string,after_widget:string,before_title:string,after_title:string,before_sidebar:string,after_sidebar:string,show_in_rest:boolean,widget_id:string,widget_name:string}'],
'WP_Widget_Factory::$widgets' => [null, '@phpstan-var' => 'array<string, \WP_Widget>'],
'WP_Widget_Factory::register' => [null, 'widget' => 'class-string<\WP_Widget>|\WP_Widget'],
'WP_Widget_Factory::unregister' => [null, 'widget' => 'class-string<\WP_Widget>|\WP_Widget'],
'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'"],
'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' => 'int<0, max>'],
'wpdb::prepare' => [null, 'query' => 'literal-string'],
];