Skip to content

Commit

Permalink
Update to WPCS v3 (#163)
Browse files Browse the repository at this point in the history
* Update to wp-cli-tests v4 (which requires WPCS v3)

* Fix all autofixable CS issues

* Rename parameter

---------

Co-authored-by: Pascal Birchler <[email protected]>
  • Loading branch information
schlessera and swissspidy authored Aug 30, 2023
1 parent 6eb56a9 commit d4d505f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion config-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 3 additions & 5 deletions src/Config_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,6 @@ public function is_true( $args, $assoc_args ) {
WP_CLI::halt( 0 );
}
WP_CLI::halt( 1 );

}

/**
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit d4d505f

Please sign in to comment.