function Table::getCellWidth
1 call to Table::getCellWidth()
- Table::calculateColumnsWidth in vendor/
symfony/ console/ Helper/ Table.php - Calculates columns widths.
File
-
vendor/
symfony/ console/ Helper/ Table.php, line 842
Class
- Table
- Provides helpers to display a table.
Namespace
Symfony\Component\Console\HelperCode
private function getCellWidth(array $row, int $column) : int {
$cellWidth = 0;
if (isset($row[$column])) {
$cell = $row[$column];
$cellWidth = Helper::width(Helper::removeDecoration($this->output
->getFormatter(), $cell));
}
$columnWidth = $this->columnWidths[$column] ?? 0;
$cellWidth = max($cellWidth, $columnWidth);
return isset($this->columnMaxWidths[$column]) ? min($this->columnMaxWidths[$column], $cellWidth) : $cellWidth;
}