From 2680f6807d9b991a589e7a9845333c2816b0e76d Mon Sep 17 00:00:00 2001 From: Marian <42134098+IanDelMar@users.noreply.github.com> Date: Wed, 29 Oct 2025 05:47:40 +0100 Subject: [PATCH] Narrow return type of current_action/filter() --- functionMap.php | 2 ++ .../return/{addslashes_gpc.php => addslashes-gpc.php} | 0 tests/data/return/current-action.php | 10 ++++++++++ tests/data/return/current-filter.php | 10 ++++++++++ wordpress-stubs.php | 2 ++ 5 files changed, 24 insertions(+) rename tests/data/return/{addslashes_gpc.php => addslashes-gpc.php} (100%) create mode 100644 tests/data/return/current-action.php create mode 100644 tests/data/return/current-filter.php diff --git a/functionMap.php b/functionMap.php index 85de493..244efef 100644 --- a/functionMap.php +++ b/functionMap.php @@ -62,6 +62,8 @@ 'check_admin_referer' => ['1|2|false', 'action' => 'string'], 'check_ajax_referer' => ['1|2|false', 'action' => 'string'], 'comment_class' => ['($display is true ? void : string)'], + 'current_action' => ['non-empty-string|false'], + 'current_filter' => ['non-empty-string|false'], 'current_time' => ["(\$type is 'timestamp'|'U' ? int : string)"], 'did_action' => ['int<0, max>'], 'edit_link' => ['int<0, max>'], diff --git a/tests/data/return/addslashes_gpc.php b/tests/data/return/addslashes-gpc.php similarity index 100% rename from tests/data/return/addslashes_gpc.php rename to tests/data/return/addslashes-gpc.php diff --git a/tests/data/return/current-action.php b/tests/data/return/current-action.php new file mode 100644 index 0000000..3080617 --- /dev/null +++ b/tests/data/return/current-action.php @@ -0,0 +1,10 @@ +