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"
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 @@
+