From 749c0b87c9fdbb2264abca7768e3a5bf60e6e005 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 12 Feb 2026 14:27:49 +0100 Subject: [PATCH 1/3] Fix newly reported PHPStan errors --- composer.json | 2 +- src/Rewrite_Command.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5de639c2..ada185bf 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "wp-cli/wp-cli": "^2.12" + "wp-cli/wp-cli": "^2.13" }, "require-dev": { "wp-cli/entity-command": "^1.3 || ^2", diff --git a/src/Rewrite_Command.php b/src/Rewrite_Command.php index e0167d9c..4a8f47e7 100644 --- a/src/Rewrite_Command.php +++ b/src/Rewrite_Command.php @@ -166,6 +166,7 @@ public function structure( $args, $assoc_args ) { /** * @var object{stdout: string, stderr: string, return_code: int} $process_run + * @phpstan-ignore varTag.type */ $process_run = WP_CLI::runcommand( $cmd ); if ( ! empty( $process_run->stderr ) ) { From e5fb1315d58304f933a8250c9c8318939f34d52a Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 13 Feb 2026 09:51:26 +0100 Subject: [PATCH 2/3] Actually pass `return => all` --- src/Rewrite_Command.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Rewrite_Command.php b/src/Rewrite_Command.php index 4a8f47e7..5c25e3ac 100644 --- a/src/Rewrite_Command.php +++ b/src/Rewrite_Command.php @@ -164,11 +164,12 @@ public function structure( $args, $assoc_args ) { } } - /** - * @var object{stdout: string, stderr: string, return_code: int} $process_run - * @phpstan-ignore varTag.type - */ - $process_run = WP_CLI::runcommand( $cmd ); + $process_run = WP_CLI::runcommand( + $cmd, + [ + 'return' => 'all', + ] + ); if ( ! empty( $process_run->stderr ) ) { // Strip "Warning: " WP_CLI::warning( substr( $process_run->stderr, 9 ) ); From 1a63bff48b31bc968ba7bf47fd7c082a88c029b2 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Sun, 15 Feb 2026 12:52:46 +0100 Subject: [PATCH 3/3] Remove dead code (?) --- src/Rewrite_Command.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/Rewrite_Command.php b/src/Rewrite_Command.php index 5c25e3ac..68d01dc6 100644 --- a/src/Rewrite_Command.php +++ b/src/Rewrite_Command.php @@ -164,16 +164,7 @@ public function structure( $args, $assoc_args ) { } } - $process_run = WP_CLI::runcommand( - $cmd, - [ - 'return' => 'all', - ] - ); - if ( ! empty( $process_run->stderr ) ) { - // Strip "Warning: " - WP_CLI::warning( substr( $process_run->stderr, 9 ) ); - } + WP_CLI::runcommand( $cmd ); } /**