Skip to content

Commit

Permalink
add support for assoc keys in CLI table helper
Browse files Browse the repository at this point in the history
  • Loading branch information
jippi committed Jul 12, 2016
1 parent 81e8d11 commit dc7ebfd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Shell/Helper/TableHelper.php
Expand Up @@ -43,10 +43,10 @@ protected function _calculateWidths($rows)
{
$widths = [];
foreach ($rows as $line) {
for ($i = 0, $len = count($line); $i < $len; $i++) {
$columnLength = mb_strlen($line[$i]);
if ($columnLength > (isset($widths[$i]) ? $widths[$i] : 0)) {
$widths[$i] = $columnLength;
foreach ($line as $k => $v) {
$columnLength = mb_strlen($line[$k]);
if ($columnLength > (isset($widths[$k]) ? $widths[$k] : 0)) {
$widths[$k] = $columnLength;
}
}
}
Expand Down

0 comments on commit dc7ebfd

Please sign in to comment.