From 5ee22011a112e34ae076a597b61dc80bee2137a4 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Wed, 25 Mar 2026 10:40:20 +0100 Subject: [PATCH 1/2] Require WP-CLI v2.13 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 00792969..ea8da175 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/wp-cli-tests": "^5" From 161d029189a8f80233c7d26392ba27b177bce2f2 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Wed, 25 Mar 2026 10:40:25 +0100 Subject: [PATCH 2/2] PHPStan fix --- phpcs.xml.dist | 2 ++ phpstan.neon.dist | 3 +++ src/Capabilities_Command.php | 3 --- src/Role_Command.php | 3 --- tests/phpstan/scan-files.php | 3 +++ 5 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 tests/phpstan/scan-files.php diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 55db4239..f447e7fb 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -55,4 +55,6 @@ */src/(Role|Capabilities)_Command\.php$ + + /tests/phpstan/scan-files diff --git a/phpstan.neon.dist b/phpstan.neon.dist index ca9e0ea4..c1118d74 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -7,7 +7,10 @@ parameters: - vendor/wp-cli/wp-cli/php scanFiles: - vendor/php-stubs/wordpress-stubs/wordpress-stubs.php + - tests/phpstan/scan-files.php treatPhpDocTypesAsCertain: false ignoreErrors: - identifier: missingType.parameter - identifier: missingType.return + dynamicConstantNames: + - ABSPATH diff --git a/src/Capabilities_Command.php b/src/Capabilities_Command.php index c421d4ff..cd810b2d 100644 --- a/src/Capabilities_Command.php +++ b/src/Capabilities_Command.php @@ -228,9 +228,6 @@ private static function get_role( $role ) { /** * Assert that the roles are persisted to the database. - * - * @throws \WP_CLI\ExitException If the roles are not persisted to the - * database. */ private static function persistence_check() { global $wp_roles; diff --git a/src/Role_Command.php b/src/Role_Command.php index 2aceed04..2a48cc44 100644 --- a/src/Role_Command.php +++ b/src/Role_Command.php @@ -407,9 +407,6 @@ public function reset( $args, $assoc_args ) { /** * Assert that the roles are persisted to the database. - * - * @throws \WP_CLI\ExitException If the roles are not persisted to the - * database. */ private static function persistence_check() { global $wp_roles; diff --git a/tests/phpstan/scan-files.php b/tests/phpstan/scan-files.php new file mode 100644 index 00000000..b871073c --- /dev/null +++ b/tests/phpstan/scan-files.php @@ -0,0 +1,3 @@ +