Platformsh\Cli\Console\AdaptiveTable::getCellWidth PHP 메소드

getCellWidth() 개인적인 메소드

This is inspired by Table->getCellWidth(), but this also accounts for multi-line cells.
private getCellWidth ( string | Symfony\Component\Console\Helper\TableCell $cell ) : float | integer
$cell string | Symfony\Component\Console\Helper\TableCell
리턴 float | integer
    private function getCellWidth($cell)
    {
        $lineWidths = [0];
        foreach (explode(PHP_EOL, $cell) as $line) {
            $lineWidths[] = Helper::strlenWithoutDecoration($this->outputCopy->getFormatter(), $line);
        }
        $cellWidth = max($lineWidths);
        if ($cell instanceof TableCell && $cell->getColspan() > 1) {
            $cellWidth /= $cell->getColspan();
        }
        return $cellWidth;
    }