Tweaks to page rendering methods

This commit is contained in:
Corey McKrill 2023-10-24 17:02:18 -07:00
parent 591c728ac3
commit 21a995bb50
No known key found for this signature in database
GPG Key ID: 84BBFE669C4D97B8
1 changed files with 9 additions and 8 deletions

View File

@ -94,8 +94,8 @@ class PageController {
switch ( $handler ) { switch ( $handler ) {
case LogHandlerFileV2::class: case LogHandlerFileV2::class:
$args = $this->get_query_params(); $params = $this->get_query_params();
$this->render_filev2( $args ); $this->render_filev2( $params );
break; break;
case 'WC_Log_Handler_DB': case 'WC_Log_Handler_DB':
WC_Admin_Status::status_logs_db(); WC_Admin_Status::status_logs_db();
@ -109,17 +109,17 @@ class PageController {
/** /**
* Render the views for the FileV2 log handler. * Render the views for the FileV2 log handler.
* *
* @param array $args Args for rendering the views. * @param array $params Args for rendering the views.
* *
* @return void * @return void
*/ */
private function render_filev2( array $args = array() ): void { private function render_filev2( array $params = array() ): void {
$view = $args['view'] ?? ''; $view = $params['view'] ?? '';
switch ( $view ) { switch ( $view ) {
case 'list_files': case 'list_files':
default: default:
$this->render_file_list_page(); $this->render_file_list_page( $params );
break; break;
case 'single_file': case 'single_file':
WC_Admin_Status::status_logs_file(); WC_Admin_Status::status_logs_file();
@ -130,11 +130,12 @@ class PageController {
/** /**
* Render the file list view. * Render the file list view.
* *
* @param array $params Args for rendering the views.
*
* @return void * @return void
*/ */
private function render_file_list_page(): void { private function render_file_list_page( array $params = array() ): void {
$defaults = $this->get_query_param_defaults(); $defaults = $this->get_query_param_defaults();
$params = $this->get_query_params();
?> ?>
<h2> <h2>