Webmozart\Console\UI\Component\Grid::getCellWrapper PHP Méthode

getCellWrapper() private méthode

private getCellWrapper ( Webmozart\Console\Api\Formatter\Formatter $formatter, $screenWidth, $excessColumnWidth, $indentation )
$formatter Webmozart\Console\Api\Formatter\Formatter
    private function getCellWrapper(Formatter $formatter, $screenWidth, $excessColumnWidth, $indentation)
    {
        $borderStyle = $this->style->getBorderStyle();
        $wrapper = new CellWrapper();
        foreach ($this->cells as $cell) {
            $wrapper->addCell($cell);
        }
        $nbColumns = min($this->maxNbColumns, $wrapper->getEstimatedNbColumns($screenWidth));
        do {
            $borderWidth = StringUtil::getLength($borderStyle->getLineVLChar()) + ($nbColumns - 1) * StringUtil::getLength($borderStyle->getLineVCChar()) + StringUtil::getLength($borderStyle->getLineVRChar());
            $availableWidth = $screenWidth - $indentation - $borderWidth - $nbColumns * $excessColumnWidth;
            $wrapper->fit($availableWidth, $nbColumns, $formatter);
            --$nbColumns;
        } while ($wrapper->hasWordCuts() && $nbColumns >= $this->minNbColumns);
        return $wrapper;
    }