|
| 1 | +<?php |
| 2 | + |
| 3 | +$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'; |
| 4 | +$cronArgsType = 'list<mixed>'; |
| 5 | + |
| 6 | +/** |
| 7 | + * This array is in the same format as the function map array in PHPStan: |
| 8 | + * |
| 9 | + * '<function_name>' => ['<return_type>', '<arg_name>'=>'<arg_type>'] |
| 10 | + * |
| 11 | + * @link https://github.com/phpstan/phpstan-src/blob/1.5.x/resources/functionMap.php |
| 12 | + */ |
| 13 | +return [ |
| 14 | + 'add_meta_box' => ['void', 'context'=>'"normal"|"side"|"advanced"', 'priority'=>'"high"|"core"|"default"|"low"'], |
| 15 | + 'addslashes_gpc' => ['T', '@phpstan-template'=>'T', 'gpc'=>'T'], |
| 16 | + 'have_posts' => ['bool', '@phpstan-impure'=>''], |
| 17 | + 'rawurlencode_deep' => ['T', '@phpstan-template'=>'T', 'value'=>'T'], |
| 18 | + 'remove_meta_box' => ['void', 'context'=>'"normal"|"side"|"advanced"'], |
| 19 | + 'sanitize_category' => ['T', '@phpstan-template'=>'T of array|object', 'category'=>'T'], |
| 20 | + 'sanitize_post' => ['T', '@phpstan-template'=>'T of array|object', 'post'=>'T'], |
| 21 | + 'sanitize_term' => ['T', '@phpstan-template'=>'T of array|object', 'term'=>'T'], |
| 22 | + 'stripslashes_deep' => ['T', '@phpstan-template'=>'T', 'value'=>'T'], |
| 23 | + 'urldecode_deep' => ['T', '@phpstan-template'=>'T', 'value'=>'T'], |
| 24 | + 'urlencode_deep' => ['T', '@phpstan-template'=>'T', 'value'=>'T'], |
| 25 | + 'wp_clear_scheduled_hook' => ['int|false|WP_Error', 'args'=>$cronArgsType], |
| 26 | + 'wp_get_schedule' => ['string|false', 'args'=>$cronArgsType], |
| 27 | + 'wp_get_scheduled_event' => ['object|false', 'args'=>$cronArgsType], |
| 28 | + 'WP_Http::get' => [$httpReturnType], |
| 29 | + 'WP_Http::head' => [$httpReturnType], |
| 30 | + 'WP_Http::post' => [$httpReturnType], |
| 31 | + 'WP_Http::request' => [$httpReturnType], |
| 32 | + 'WP_List_Table::bulk_actions' => ['void', 'which'=>'"top"|"bottom"'], |
| 33 | + 'WP_List_Table::display_tablenav' => ['void', 'which'=>'"top"|"bottom"'], |
| 34 | + 'WP_List_Table::pagination' => ['void', 'which'=>'"top"|"bottom"'], |
| 35 | + 'wp_next_scheduled' => ['int|false', 'args'=>$cronArgsType], |
| 36 | + 'WP_Query::have_posts' => ['bool', '@phpstan-impure'=>''], |
| 37 | + 'wp_remote_get' => [$httpReturnType], |
| 38 | + 'wp_remote_head' => [$httpReturnType], |
| 39 | + 'wp_remote_post' => [$httpReturnType], |
| 40 | + 'wp_remote_request' => [$httpReturnType], |
| 41 | + 'wp_reschedule_event' => ['bool|WP_Error', 'args'=>$cronArgsType], |
| 42 | + 'wp_safe_remote_get' => [$httpReturnType], |
| 43 | + 'wp_safe_remote_head' => [$httpReturnType], |
| 44 | + 'wp_safe_remote_post' => [$httpReturnType], |
| 45 | + 'wp_safe_remote_request' => [$httpReturnType], |
| 46 | + 'wp_schedule_event' => ['bool|WP_Error', 'args'=>$cronArgsType], |
| 47 | + 'wp_schedule_single_event' => ['bool|WP_Error', 'args'=>$cronArgsType], |
| 48 | + 'wp_slash' => ['T', '@phpstan-template'=>'T', 'value'=>'T'], |
| 49 | + 'wp_unschedule_event' => ['bool|WP_Error', 'args'=>$cronArgsType], |
| 50 | + 'wp_unslash' => ['T', '@phpstan-template'=>'T', 'value'=>'T'], |
| 51 | +]; |
0 commit comments