From 2d27f0db5c36f5aa0064abecddd6d05f28c4d001 Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Fri, 21 Jul 2023 04:37:15 -0700 Subject: [PATCH] Prevent warnings in PHP 8.2 when `$col_values` is empty (#160) --- lib/cli/table/Ascii.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cli/table/Ascii.php b/lib/cli/table/Ascii.php index cb2e8a8..27e94e9 100644 --- a/lib/cli/table/Ascii.php +++ b/lib/cli/table/Ascii.php @@ -180,7 +180,7 @@ public function row( array $row ) { $row_values = array(); $has_more = false; foreach( $extra_rows as $col => &$col_values ) { - $row_values[ $col ] = array_shift( $col_values ); + $row_values[ $col ] = ! empty( $col_values ) ? array_shift( $col_values ) : ''; if ( count( $col_values ) ) { $has_more = true; }