diff --git a/functionMap.php b/functionMap.php index 6c2805d..67590fe 100644 --- a/functionMap.php +++ b/functionMap.php @@ -133,7 +133,7 @@ 'rest_ensure_response' => ['($response is \WP_Error ? \WP_Error : \WP_REST_Response)'], 'sanitize_bookmark_field' => ['array|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', '@phpstan-template' => 'T of array|object', 'post' => '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_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_title_with_dashes' => ['lowercase-string', 'context' => "'display'|'save'"], diff --git a/tests/data/return/sanitize-post.php b/tests/data/return/sanitize-post.php new file mode 100644 index 0000000..c28f81b --- /dev/null +++ b/tests/data/return/sanitize-post.php @@ -0,0 +1,25 @@ +