From 6e4ff59d39bd8633e6833f01261e556b35248f78 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 6 Aug 2026 11:03:13 +0200 Subject: [PATCH 1/2] Fix newly reported PHPStan errors --- src/Font_Collection_Command.php | 1 + src/WP_CLI/CommandWithMeta.php | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Font_Collection_Command.php b/src/Font_Collection_Command.php index 6a81a26e6..277a169c9 100644 --- a/src/Font_Collection_Command.php +++ b/src/Font_Collection_Command.php @@ -394,6 +394,7 @@ public function list_categories( $args, $assoc_args ) { $fields = [ 'slug', 'name' ]; $formatter = new Formatter( $assoc_args, $fields, 'category' ); + /** @var array> $categories */ $formatter->display_items( $categories ); } diff --git a/src/WP_CLI/CommandWithMeta.php b/src/WP_CLI/CommandWithMeta.php index d32391998..708fa3a6d 100644 --- a/src/WP_CLI/CommandWithMeta.php +++ b/src/WP_CLI/CommandWithMeta.php @@ -264,6 +264,7 @@ public function add( $args, $assoc_args ) { list( $object_id, $meta_key ) = $args; $meta_value = WP_CLI::get_value_from_arg_or_stdin( $args, 2 ); + /** @var array|string $meta_value */ $meta_value = WP_CLI::read_value( $meta_value, $assoc_args ); $object_id = $this->check_object_id( $object_id ); From d11edb53ef85a2717eeff6fb5ce238a899ae2841 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 6 Aug 2026 12:54:24 +0200 Subject: [PATCH 2/2] Address code review feedback --- src/Font_Collection_Command.php | 2 +- src/WP_CLI/CommandWithMeta.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Font_Collection_Command.php b/src/Font_Collection_Command.php index 277a169c9..843e34114 100644 --- a/src/Font_Collection_Command.php +++ b/src/Font_Collection_Command.php @@ -394,7 +394,7 @@ public function list_categories( $args, $assoc_args ) { $fields = [ 'slug', 'name' ]; $formatter = new Formatter( $assoc_args, $fields, 'category' ); - /** @var array> $categories */ + /** @var FontCategory[] $categories */ $formatter->display_items( $categories ); } diff --git a/src/WP_CLI/CommandWithMeta.php b/src/WP_CLI/CommandWithMeta.php index 708fa3a6d..a8a15893f 100644 --- a/src/WP_CLI/CommandWithMeta.php +++ b/src/WP_CLI/CommandWithMeta.php @@ -264,7 +264,7 @@ public function add( $args, $assoc_args ) { list( $object_id, $meta_key ) = $args; $meta_value = WP_CLI::get_value_from_arg_or_stdin( $args, 2 ); - /** @var array|string $meta_value */ + /** @var array|string $meta_value */ $meta_value = WP_CLI::read_value( $meta_value, $assoc_args ); $object_id = $this->check_object_id( $object_id );