Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions functionMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
'comment_class' => ['($display is true ? void : string)'],
'current_time' => ["(\$type is 'timestamp'|'U' ? int : string)"],
'did_action' => ['int<0, max>'],
'did_filter' => ['int<0, max>'],
'edit_link' => ['int<0, max>'],
'edit_term_link' => ['($display is true ? void : string|void)'],
'get_approved_comments' => ["(\$args is array{count: true}&array ? int : (\$args is array{fields: 'ids'}&array ? array<int, int> : array<int, \WP_Comment>))"],
Expand Down
10 changes: 10 additions & 0 deletions tests/data/return/did-action.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace PhpStubs\WordPress\Core\Tests;

use function did_action;
use function PHPStan\Testing\assertType;

assertType('int<0, max>', did_action('hook_name'));
10 changes: 10 additions & 0 deletions tests/data/return/did-filter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace PhpStubs\WordPress\Core\Tests;

use function did_filter;
use function PHPStan\Testing\assertType;

assertType('int<0, max>', did_filter('hook_name'));
1 change: 1 addition & 0 deletions wordpress-stubs.php
Original file line number Diff line number Diff line change
Expand Up @@ -129545,6 +129545,7 @@ function doing_filter($hook_name = \null)
*
* @param string $hook_name The name of the filter hook.
* @return int The number of times the filter hook has been applied.
* @phpstan-return int<0, max>
*/
function did_filter($hook_name)
{
Expand Down