From b570e9b4ce1e185d16c48926c0ec88f530c9d089 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 4 Jul 2025 10:42:41 +0200 Subject: [PATCH] PHPStan level 9 --- composer.json | 2 +- phpstan.neon.dist | 13 +++++++++++++ src/Server_Command.php | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 phpstan.neon.dist diff --git a/composer.json b/composer.json index b447a72..1d86846 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": "^2", diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 0000000..6fe826f --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,13 @@ +parameters: + level: 9 + paths: + - src + - server-command.php + scanDirectories: + - vendor/wp-cli/wp-cli/php + scanFiles: + - vendor/php-stubs/wordpress-stubs/wordpress-stubs.php + treatPhpDocTypesAsCertain: false + ignoreErrors: + - identifier: missingType.parameter + - identifier: missingType.return diff --git a/src/Server_Command.php b/src/Server_Command.php index e82a44c..7b37992 100644 --- a/src/Server_Command.php +++ b/src/Server_Command.php @@ -103,6 +103,7 @@ public function __invoke( $_, $assoc_args ) { $options['bypass_shell'] = true; } + // @phpstan-ignore argument.type exit( proc_close( proc_open( $cmd, $descriptors, $pipes, null, null, $options ) ) ); } }