From 231a52933dd5f08af904c007271e388fc3b6c864 Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Fri, 26 Aug 2016 07:05:20 -0700 Subject: [PATCH] Consolidate calls to the formatter --- inc/class-command.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/inc/class-command.php b/inc/class-command.php index 441994d..ce78ecc 100644 --- a/inc/class-command.php +++ b/inc/class-command.php @@ -117,7 +117,7 @@ class Command { } if ( $this->focus_scope ) { - $focus_fields = array( + $fields = array( 'hook', 'execution_time', 'query_time', @@ -129,21 +129,21 @@ class Command { $this->focus_log[ $hook ]['hook'] = ''; } } - $formatter = new Formatter( $assoc_args, $focus_fields ); - $formatter->display_items( $this->focus_log ); + $data = $this->focus_log; } else if ( $this->focus_hook ) { - $hook_fields = array( + $fields = array( 'callback', 'execution_time', 'query_time', 'query_count', ); - $formatter = new Formatter( $assoc_args, $hook_fields ); - $formatter->display_items( $this->hook_log ); + $data = $this->hook_log; } else { - $formatter = new Formatter( $assoc_args, $scope_fields ); - $formatter->display_items( $this->scope_log ); + $fields = $scope_fields; + $data = $this->scope_log; } + $formatter = new Formatter( $assoc_args, $fields ); + $formatter->display_items( $data ); } /**