Skip to content

Commit

Permalink
fixed empty string bug
Browse files Browse the repository at this point in the history
Widths for columns that contain an empty string are not added, and
produces a bug where there are fewer headings then columns per row.
  • Loading branch information
thinkingmedia committed Jan 6, 2017
1 parent 9520f59 commit bc2e828
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Shell/Helper/TableHelper.php
Expand Up @@ -45,7 +45,7 @@ protected function _calculateWidths($rows)
foreach ($rows as $line) {
foreach ($line as $k => $v) {
$columnLength = mb_strwidth($line[$k]);
if ($columnLength > (isset($widths[$k]) ? $widths[$k] : 0)) {
if ($columnLength >= (isset($widths[$k]) ? $widths[$k] : 0)) {
$widths[$k] = $columnLength;
}
}
Expand Down

0 comments on commit bc2e828

Please sign in to comment.