Box\Spout\Writer\Common\Helper\AbstractStyleHelper::applyWrapTextIfCellContainsNewLine PHP Метод

applyWrapTextIfCellContainsNewLine() защищенный Метод

Set the "wrap text" option if a cell of the given row contains a new line.
protected applyWrapTextIfCellContainsNewLine ( Style $style, array $dataRow ) : Style
$style Box\Spout\Writer\Style\Style The original style
$dataRow array The row the style will be applied to
Результат Box\Spout\Writer\Style\Style The eventually updated style
    protected function applyWrapTextIfCellContainsNewLine($style, $dataRow)
    {
        // if the "wrap text" option is already set, no-op
        if ($style->hasSetWrapText()) {
            return $style;
        }
        foreach ($dataRow as $cell) {
            if (is_string($cell) && strpos($cell, "\n") !== false) {
                $style->setShouldWrapText();
                break;
            }
        }
        return $style;
    }