Skip to content

Commit 6665a04

Browse files
authored
Narrow return type of did_action() (#273)
Closes #271
1 parent e466012 commit 6665a04

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

functionMap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,4 +218,5 @@
218218
'wp_create_nonce' => [null, 'action' => '-1|string'],
219219
'wp_nonce_url' => [null, 'action' => '-1|string'],
220220
'wp_nonce_field' => [null, 'action' => '-1|string'],
221+
'did_action' => ['int<0, max>'],
221222
];

wordpress-stubs.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128905,6 +128905,7 @@ function doing_action($hook_name = \null)
128905128905
*
128906128906
* @param string $hook_name The name of the action hook.
128907128907
* @return int The number of times the action hook has been fired.
128908+
* @phpstan-return int<0, max>
128908128909
*/
128909128910
function did_action($hook_name)
128910128911
{

0 commit comments

Comments
 (0)