From d4d505f5d071871259b2e260cf35085209d4dece Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Wed, 30 Aug 2023 17:15:17 +0200 Subject: [PATCH] Update to WPCS v3 (#163) * Update to wp-cli-tests v4 (which requires WPCS v3) * Fix all autofixable CS issues * Rename parameter --------- Co-authored-by: Pascal Birchler --- composer.json | 2 +- config-command.php | 2 +- src/Config_Command.php | 8 +++----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index c6de1d69d..1147d9838 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ }, "require-dev": { "wp-cli/db-command": "^1.3 || ^2", - "wp-cli/wp-cli-tests": "^3.1" + "wp-cli/wp-cli-tests": "^4" }, "config": { "process-timeout": 7200, diff --git a/config-command.php b/config-command.php index fa1971fbf..290f539e6 100644 --- a/config-command.php +++ b/config-command.php @@ -4,7 +4,7 @@ return; } -$wpcli_config_autoloader = dirname( __FILE__ ) . '/vendor/autoload.php'; +$wpcli_config_autoloader = __DIR__ . '/vendor/autoload.php'; if ( file_exists( $wpcli_config_autoloader ) ) { require_once $wpcli_config_autoloader; } diff --git a/src/Config_Command.php b/src/Config_Command.php index 0c166646c..95a486edb 100644 --- a/src/Config_Command.php +++ b/src/Config_Command.php @@ -466,7 +466,6 @@ public function is_true( $args, $assoc_args ) { WP_CLI::halt( 0 ); } WP_CLI::halt( 1 ); - } /** @@ -857,21 +856,20 @@ public function shuffle_salts( $args, $assoc_args ) { } WP_CLI::success( 'Shuffled the salt keys.' ); - } /** * Filters wp-config.php file configurations. * - * @param array $list + * @param array $vars * @param array $previous_list * @param string $type * @param array $exclude_list * @return array */ - private static function get_wp_config_diff( $list, $previous_list, $type, $exclude_list = [] ) { + private static function get_wp_config_diff( $vars, $previous_list, $type, $exclude_list = [] ) { $result = []; - foreach ( $list as $name => $val ) { + foreach ( $vars as $name => $val ) { if ( array_key_exists( $name, $previous_list ) || in_array( $name, $exclude_list, true ) ) { continue; }