-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to WPCS v3 #176
Update to WPCS v3 #176
Changes from all commits
60f7d8d
eb88d7b
ddbeaaf
0f14ebd
2cf2897
8626e7b
7660405
08e7081
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
"wp-cli/core-command": "^1 || ^2", | ||
"wp-cli/eval-command": "^1 || ^2", | ||
"wp-cli/wp-cli": "^2.5.1", | ||
"wp-coding-standards/wpcs": "^2.3.0", | ||
"wp-coding-standards/wpcs": "^3", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Recommended: remove the explicit |
||
"yoast/phpunit-polyfills": "^1.0.3" | ||
}, | ||
"require-dev": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1061,7 +1061,7 @@ private static function log_run_times_after_scenario( $scope ) { | |
$scenario_key = self::get_scenario_key( $scope ); | ||
if ( $scenario_key ) { | ||
self::$scenario_run_times[ $scenario_key ] += microtime( true ); | ||
self::$scenario_count++; | ||
++self::$scenario_count; | ||
if ( count( self::$scenario_run_times ) > self::$num_top_scenarios ) { | ||
arsort( self::$scenario_run_times ); | ||
array_pop( self::$scenario_run_times ); | ||
|
@@ -1094,11 +1094,9 @@ private static function dir_diff_copy( $upd_dir, $src_dir, $cop_dir ) { | |
throw new RuntimeException( sprintf( "Failed to create copy directory '%s': %s. " . __FILE__ . ':' . __LINE__, $cop_file, $error['message'] ) ); | ||
} | ||
self::copy_dir( $upd_file, $cop_file ); | ||
} else { | ||
if ( ! copy( $upd_file, $cop_file ) ) { | ||
} elseif ( ! copy( $upd_file, $cop_file ) ) { | ||
$error = error_get_last(); | ||
throw new RuntimeException( sprintf( "Failed to copy '%s' to '%s': %s. " . __FILE__ . ':' . __LINE__, $upd_file, $cop_file, $error['message'] ) ); | ||
Comment on lines
1098
to
1099
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like the indent here didn't get fixed ? |
||
} | ||
} | ||
} elseif ( is_dir( $upd_file ) ) { | ||
self::dir_diff_copy( $upd_file, $src_file, $cop_file ); | ||
|
@@ -1229,10 +1227,11 @@ private static function log_proc_method_run_time( $key, $start_time ) { | |
self::$proc_method_run_times[ $key ] = [ 0, 0 ]; | ||
} | ||
self::$proc_method_run_times[ $key ][0] += $run_time; | ||
self::$proc_method_run_times[ $key ][1]++; | ||
++self::$proc_method_run_times[ $key ][1]; | ||
} | ||
} | ||
|
||
// phpcs:ignore Universal.Files.SeparateFunctionsFromOO.Mixed | ||
function wp_cli_behat_env_debug( $message ) { | ||
if ( ! getenv( 'WP_CLI_TEST_DEBUG_BEHAT_ENV' ) ) { | ||
return; | ||
|
@@ -1301,7 +1300,6 @@ function wpcli_bootstrap_behat_feature_context() { | |
|
||
wp_cli_behat_env_debug( "Project config file location: {$project_config}" ); | ||
wp_cli_behat_env_debug( "Project config:\n{$contents}" ); | ||
|
||
} | ||
|
||
wpcli_bootstrap_behat_feature_context(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,4 +59,3 @@ function wpcli_tests_include_config( array $config_filenames = [] ) { | |
'.phpunit.xml.dist', | ||
] | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also add
is_writable()