Webmozart\Console\UI\Style\GridStyle::getCellFormat PHP Method

getCellFormat() public method

Returns the format string for rendering cells.
public getCellFormat ( ) : string
return string The format string. The string contains the substring "%s" where the cell content is inserted.
    public function getCellFormat()
    {
        return $this->cellFormat;
    }

Usage Example

Example #1
0
 private function renderRows(IO $io, array $rows, array $columnLengths, $excessColumnLength, $indentation)
 {
     $alignments = array_fill(0, count($columnLengths), $this->style->getCellAlignment());
     $borderStyle = $this->style->getBorderStyle();
     $borderColumnLengths = array_map(function ($length) use($excessColumnLength) {
         return $length + $excessColumnLength;
     }, $columnLengths);
     BorderUtil::drawTopBorder($io, $borderStyle, $borderColumnLengths, $indentation);
     $last = count($rows) - 1;
     foreach ($rows as $i => $row) {
         BorderUtil::drawRow($io, $borderStyle, $row, $columnLengths, $alignments, $this->style->getCellFormat(), $this->style->getCellStyle(), $this->style->getPaddingChar(), $indentation);
         if ($i < $last) {
             BorderUtil::drawMiddleBorder($io, $borderStyle, $borderColumnLengths, $indentation);
         }
     }
     BorderUtil::drawBottomBorder($io, $borderStyle, $borderColumnLengths, $indentation);
 }