PHP Класс Platformsh\Cli\Console\AdaptiveTable

Наследование: extends Symfony\Component\Console\Helper\Table
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$headersCopy
$maxTableWidth integer
$minColumnWidth integer
$outputCopy
$rowsCopy parent Table class.

Открытые методы

Метод Описание
__construct ( Symfony\Component\Console\Output\OutputInterface $output, integer | null $maxTableWidth = null, integer | null $minColumnWidth = 10 ) AdaptiveTable constructor.
addRow ( $row )
render ( )
setHeaders ( array $headers )

Защищенные методы

Метод Описание
adaptCells ( array $rows, array $maxColumnWidths ) : array Modify table rows, wrapping their cells' content to the max column width.
adaptRows ( ) Adapt rows based on the terminal width.
getMaxColumnWidths ( ) : array
getMaxContentWidth ( integer $columnCount ) : integer Find the maximum content width (excluding decoration) for each table row.
getTerminalWidth ( integer $default = 120 ) : integer
wrapCell ( string $contents, integer $width ) : string Word-wrap the contents of a cell, so that they fit inside a max width.

Приватные методы

Метод Описание
getCellWidth ( string | Symfony\Component\Console\Helper\TableCell $cell ) : float | integer Get the default width of a table cell (the length of its longest line).

Описание методов

__construct() публичный метод

AdaptiveTable constructor.
public __construct ( Symfony\Component\Console\Output\OutputInterface $output, integer | null $maxTableWidth = null, integer | null $minColumnWidth = 10 )
$output Symfony\Component\Console\Output\OutputInterface
$maxTableWidth integer | null
$minColumnWidth integer | null

adaptCells() защищенный метод

Modify table rows, wrapping their cells' content to the max column width.
protected adaptCells ( array $rows, array $maxColumnWidths ) : array
$rows array
$maxColumnWidths array
Результат array

adaptRows() защищенный метод

Adapt rows based on the terminal width.
protected adaptRows ( )

addRow() публичный метод

Overrides Table->addRow() so the row content can be accessed.
public addRow ( $row )

getMaxColumnWidths() защищенный метод

protected getMaxColumnWidths ( ) : array
Результат array An array of the maximum column widths that fit into the table width, keyed by the column number.

getMaxContentWidth() защищенный метод

Find the maximum content width (excluding decoration) for each table row.
protected getMaxContentWidth ( integer $columnCount ) : integer
$columnCount integer The number of columns in the table.
Результат integer The maximum table width, minus the width taken up by decoration.

getTerminalWidth() защищенный метод

protected getTerminalWidth ( integer $default = 120 ) : integer
$default integer
Результат integer

render() публичный метод

Overrides Table->render(), to adapt all the cells to the table width.
public render ( )

setHeaders() публичный метод

Overrides Table->setHeaders() so the header content can be accessed.
public setHeaders ( array $headers )
$headers array

wrapCell() защищенный метод

Word-wrap the contents of a cell, so that they fit inside a max width.
protected wrapCell ( string $contents, integer $width ) : string
$contents string
$width integer
Результат string

Описание свойств

$headersCopy защищенное свойство

protected $headersCopy

$maxTableWidth защищенное свойство

protected int $maxTableWidth
Результат integer

$minColumnWidth защищенное свойство

protected int $minColumnWidth
Результат integer

$outputCopy защищенное свойство

protected $outputCopy

$rowsCopy защищенное свойство

parent Table class.
protected $rowsCopy