You are here

private function Table::calculateNumberOfColumns in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Helper/Table.php \Symfony\Component\Console\Helper\Table::calculateNumberOfColumns()

Calculate number of columns for this table.

1 call to Table::calculateNumberOfColumns()
Table::render in vendor/symfony/console/Helper/Table.php
Renders table to output.

File

vendor/symfony/console/Helper/Table.php, line 320

Class

Table
Provides helpers to display a table.

Namespace

Symfony\Component\Console\Helper

Code

private function calculateNumberOfColumns() {
  if (null !== $this->numberOfColumns) {
    return;
  }
  $columns = array(
    0,
  );
  foreach (array_merge($this->headers, $this->rows) as $row) {
    if ($row instanceof TableSeparator) {
      continue;
    }
    $columns[] = $this
      ->getNumberOfColumns($row);
  }
  return $this->numberOfColumns = max($columns);
}