Platformsh\Cli\Console\AdaptiveTable::adaptCells PHP Method

adaptCells() protected method

Modify table rows, wrapping their cells' content to the max column width.
protected adaptCells ( array $rows, array $maxColumnWidths ) : array
$rows array
$maxColumnWidths array
return array
    protected function adaptCells(array $rows, array $maxColumnWidths)
    {
        foreach ($rows as $rowNum => &$row) {
            if ($row instanceof TableSeparator) {
                continue;
            }
            foreach ($row as $column => &$cell) {
                $cellWidth = $this->getCellWidth($cell);
                if ($cellWidth > $maxColumnWidths[$column]) {
                    $cell = $this->wrapCell($cell, $maxColumnWidths[$column]);
                }
            }
        }
        return $rows;
    }