From ec04066cd44d9f2794d882eb31e0db5f2ee051be Mon Sep 17 00:00:00 2001 From: Marian <42134098+IanDelMar@users.noreply.github.com> Date: Wed, 5 Feb 2025 18:49:16 +0100 Subject: [PATCH] Narrow return type of did_action() Closes #271 --- functionMap.php | 1 + wordpress-stubs.php | 1 + 2 files changed, 2 insertions(+) diff --git a/functionMap.php b/functionMap.php index ed334ae..59d4d0f 100644 --- a/functionMap.php +++ b/functionMap.php @@ -218,4 +218,5 @@ 'wp_create_nonce' => [null, 'action' => '-1|string'], 'wp_nonce_url' => [null, 'action' => '-1|string'], 'wp_nonce_field' => [null, 'action' => '-1|string'], + 'did_action' => ['int<0, max>'], ]; diff --git a/wordpress-stubs.php b/wordpress-stubs.php index e688ad3..c6e4aa0 100644 --- a/wordpress-stubs.php +++ b/wordpress-stubs.php @@ -128905,6 +128905,7 @@ function doing_action($hook_name = \null) * * @param string $hook_name The name of the action hook. * @return int The number of times the action hook has been fired. + * @phpstan-return int<0, max> */ function did_action($hook_name) {