From d51a18884a2ccb6602a2278d92aba4607c0c2394 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Tue, 25 Sep 2018 18:49:32 +0200 Subject: [PATCH] Fix CS issues --- inc/class-command.php | 17 ++++++++++++----- inc/class-formatter.php | 3 ++- inc/class-profiler.php | 9 +++++---- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/inc/class-command.php b/inc/class-command.php index 513ebda..a44f978 100644 --- a/inc/class-command.php +++ b/inc/class-command.php @@ -290,9 +290,12 @@ class Command { $orderby = Utils\get_flag_value( $assoc_args, 'orderby', null ); self::profile_eval_ish( - $assoc_args, function() use ( $statement ) { + $assoc_args, + function() use ( $statement ) { eval( $statement ); // phpcs:ignore Squiz.PHP.Eval.Discouraged -- no other way oround here - }, $order, $orderby + }, + $order, + $orderby ); } @@ -351,9 +354,12 @@ class Command { } self::profile_eval_ish( - $assoc_args, function() use ( $file ) { + $assoc_args, + function() use ( $file ) { self::include_file( $file ); - }, $order, $orderby + }, + $order, + $orderby ); } @@ -387,7 +393,8 @@ class Command { $loggers = array( $logger ); } $fields = array_merge( - $fields, array( + $fields, + array( 'time', 'query_time', 'query_count', diff --git a/inc/class-formatter.php b/inc/class-formatter.php index 51fcf03..1a44f53 100644 --- a/inc/class-formatter.php +++ b/inc/class-formatter.php @@ -91,7 +91,8 @@ class Formatter { if ( $orderby ) { usort( - $items, function( $a, $b ) use ( $order, $orderby ) { + $items, + function( $a, $b ) use ( $order, $orderby ) { list( $first, $second ) = 'ASC' === $order ? array( $a, $b ) : array( $b, $a ); if ( is_numeric( $first->$orderby ) && is_numeric( $second->$orderby ) ) { diff --git a/inc/class-profiler.php b/inc/class-profiler.php index 8537a26..5a6d3ab 100644 --- a/inc/class-profiler.php +++ b/inc/class-profiler.php @@ -76,7 +76,8 @@ class Profiler { */ public function run() { WP_CLI::add_wp_hook( - 'muplugins_loaded', function() { + 'muplugins_loaded', + function() { if ( $url = WP_CLI::get_runner()->config['url'] ) { WP_CLI::set_url( trailingslashit( $url ) ); } else { @@ -85,7 +86,8 @@ class Profiler { } ); WP_CLI::add_hook( - 'after_wp_config_load', function() { + 'after_wp_config_load', + function() { if ( defined( 'SAVEQUERIES' ) && ! SAVEQUERIES ) { WP_CLI::error( "'SAVEQUERIES' is defined as false, and must be true. Please check your wp-config.php" ); } @@ -263,8 +265,7 @@ class Profiler { if ( false !== $key && isset( $this->current_stage_hooks[ $key + 1 ] ) ) { $pseudo_hook = "{$this->current_stage_hooks[$key+1]}:before"; } else { - $pseudo_hook = "{$this->current_stage_hooks[$key]}:after"; - ; + $pseudo_hook = "{$this->current_stage_hooks[$key]}:after"; $this->running_hook = $pseudo_hook; } $this->loggers[ $pseudo_hook ] = new Logger( array( 'hook' => $pseudo_hook ) );