You are here

private function Table::getNumberOfColumns in Zircon Profile 8.0

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

Gets number of columns by row.

Parameters

array $row:

Return value

int

2 calls to Table::getNumberOfColumns()
Table::calculateNumberOfColumns in vendor/symfony/console/Helper/Table.php
Calculate number of columns for this table.
Table::fillNextRows in vendor/symfony/console/Helper/Table.php
fill rows that contains rowspan > 1.

File

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

Class

Table
Provides helpers to display a table.

Namespace

Symfony\Component\Console\Helper

Code

private function getNumberOfColumns(array $row) {
  $columns = count($row);
  foreach ($row as $column) {
    $columns += $column instanceof TableCell ? $column
      ->getColspan() - 1 : 0;
  }
  return $columns;
}