From bdbf8b2b2e82e8eba80afea31f4dc11f3afa30d4 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 11 Aug 2022 12:36:33 +0100 Subject: [PATCH] Corrections to PHPStan-specific tags. --- src/WP_Block_Type.php | 3 ++- src/register_taxonomy.php | 6 +++--- src/wp_nav_menu.php | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/WP_Block_Type.php b/src/WP_Block_Type.php index 3c59845..77a8539 100644 --- a/src/WP_Block_Type.php +++ b/src/WP_Block_Type.php @@ -96,7 +96,8 @@ class WP_Block_Type extends Shared\Base { /** * Block type render callback. * - * @var callable(array, string): string + * @var callable + * @phpstan-var callable(array, string): string */ public $render_callback; diff --git a/src/register_taxonomy.php b/src/register_taxonomy.php index e46134e..95484dd 100644 --- a/src/register_taxonomy.php +++ b/src/register_taxonomy.php @@ -107,7 +107,7 @@ class register_taxonomy extends Shared\Base { * Provide a callback function for the meta box display. If not set, `post_categories_meta_box()` is used for hierarchical taxonomies, and `post_tags_meta_box()` is used for non-hierarchical. If false, no meta box is shown. * * @var false|callable - * @phpstan-var false|callable(\WP_Post,mixed[]) : void + * @phpstan-var false|callable(\WP_Post,mixed[]): void */ public $meta_box_cb; @@ -115,7 +115,7 @@ class register_taxonomy extends Shared\Base { * Callback function for sanitizing taxonomy data saved from a meta box. If no callback is defined, an appropriate one is determined based on the value of `$meta_box_cb`. * * @var callable - * @phpstan-var callable(string,mixed) : (int|string)[] + * @phpstan-var callable(string,mixed): (int|string)[] */ public $meta_box_sanitize_cb; @@ -166,7 +166,7 @@ class register_taxonomy extends Shared\Base { * Default `_update_generic_term_count()` for taxonomies attached to other object types, such as users. * * @var callable - * @phpstan-var callable(int[],\WP_Taxonomy) : void + * @phpstan-var callable(int[],\WP_Taxonomy): void */ public $update_count_callback; diff --git a/src/wp_nav_menu.php b/src/wp_nav_menu.php index 979c6ba..d9b3994 100644 --- a/src/wp_nav_menu.php +++ b/src/wp_nav_menu.php @@ -70,7 +70,7 @@ class wp_nav_menu extends Shared\Base { * Default is 'wp_page_menu'. Set to false for no fallback. * * @var callable|false - * @phpstan-var (callable(mixed[]):(string|void))|false + * @phpstan-var (callable(mixed[]): (string|void))|false */ public $fallback_cb;