PHP Class Platformsh\Cli\Console\AdaptiveTable

Inheritance: extends Symfony\Component\Console\Helper\Table
Afficher le fichier Open project: commerceguys/platform-cli Class Usage Examples

Protected Properties

Свойство Type Description
$headersCopy
$maxTableWidth integer
$minColumnWidth integer
$outputCopy
$rowsCopy parent Table class.

Méthodes publiques

Méthode Description
__construct ( Symfony\Component\Console\Output\OutputInterface $output, integer | null $maxTableWidth = null, integer | null $minColumnWidth = 10 ) AdaptiveTable constructor.
addRow ( $row )
render ( )
setHeaders ( array $headers )

Méthodes protégées

Méthode Description
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.

Private Methods

Méthode Description
getCellWidth ( string | Symfony\Component\Console\Helper\TableCell $cell ) : float | integer Get the default width of a table cell (the length of its longest line).

Method Details

__construct() public méthode

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() protected méthode

Modify table rows, wrapping their cells' content to the max column width.
protected adaptCells ( array $rows, array $maxColumnWidths ) : array
$rows array
$maxColumnWidths array
Résultat array

adaptRows() protected méthode

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

addRow() public méthode

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

getMaxColumnWidths() protected méthode

protected getMaxColumnWidths ( ) : array
Résultat array An array of the maximum column widths that fit into the table width, keyed by the column number.

getMaxContentWidth() protected méthode

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.
Résultat integer The maximum table width, minus the width taken up by decoration.

getTerminalWidth() protected méthode

protected getTerminalWidth ( integer $default = 120 ) : integer
$default integer
Résultat integer

render() public méthode

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

setHeaders() public méthode

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

wrapCell() protected méthode

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
Résultat string

Property Details

$headersCopy protected_oe property

protected $headersCopy

$maxTableWidth protected_oe property

protected int $maxTableWidth
Résultat integer

$minColumnWidth protected_oe property

protected int $minColumnWidth
Résultat integer

$outputCopy protected_oe property

protected $outputCopy

$rowsCopy protected_oe property

parent Table class.
protected $rowsCopy