mirror of
https://hk.gh-proxy.com/https://github.com/wp-cli/profile-command.git
synced 2025-08-21 06:38:51 +08:00
Merge pull request #22 from runcommand/consolidate
Consolidate calls to the formatter
This commit is contained in:
commit
18fedabd01
1 changed files with 8 additions and 8 deletions
|
@ -117,7 +117,7 @@ class Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $this->focus_scope ) {
|
if ( $this->focus_scope ) {
|
||||||
$focus_fields = array(
|
$fields = array(
|
||||||
'hook',
|
'hook',
|
||||||
'execution_time',
|
'execution_time',
|
||||||
'query_time',
|
'query_time',
|
||||||
|
@ -129,21 +129,21 @@ class Command {
|
||||||
$this->focus_log[ $hook ]['hook'] = '';
|
$this->focus_log[ $hook ]['hook'] = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$formatter = new Formatter( $assoc_args, $focus_fields );
|
$data = $this->focus_log;
|
||||||
$formatter->display_items( $this->focus_log );
|
|
||||||
} else if ( $this->focus_hook ) {
|
} else if ( $this->focus_hook ) {
|
||||||
$hook_fields = array(
|
$fields = array(
|
||||||
'callback',
|
'callback',
|
||||||
'execution_time',
|
'execution_time',
|
||||||
'query_time',
|
'query_time',
|
||||||
'query_count',
|
'query_count',
|
||||||
);
|
);
|
||||||
$formatter = new Formatter( $assoc_args, $hook_fields );
|
$data = $this->hook_log;
|
||||||
$formatter->display_items( $this->hook_log );
|
|
||||||
} else {
|
} else {
|
||||||
$formatter = new Formatter( $assoc_args, $scope_fields );
|
$fields = $scope_fields;
|
||||||
$formatter->display_items( $this->scope_log );
|
$data = $this->scope_log;
|
||||||
}
|
}
|
||||||
|
$formatter = new Formatter( $assoc_args, $fields );
|
||||||
|
$formatter->display_items( $data );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue