diff --git a/php/src/file/csv/CsvBuilder.php b/php/src/file/csv/CsvBuilder.php index 1147e02..c1ac0bc 100644 --- a/php/src/file/csv/CsvBuilder.php +++ b/php/src/file/csv/CsvBuilder.php @@ -17,7 +17,7 @@ class CsvBuilder extends AbstractBuilder { parent::__construct($output, $params); } - protected function _write(array $row): void { + protected function _write(array $row, ?array $rowStyle=null): void { $this->fputcsv($row); } diff --git a/php/src/file/tab/AbstractBuilder.php b/php/src/file/tab/AbstractBuilder.php index 0a48bc9..ba913f4 100644 --- a/php/src/file/tab/AbstractBuilder.php +++ b/php/src/file/tab/AbstractBuilder.php @@ -69,7 +69,7 @@ abstract class AbstractBuilder extends TempStream implements IBuilder { $this->headers = $headers; } - protected abstract function _write(array $row): void; + protected abstract function _write(array $row, ?array $rowStyle=null): void; protected bool $wroteHeaders = false; @@ -101,14 +101,14 @@ abstract class AbstractBuilder extends TempStream implements IBuilder { return $row; } - function write(?array $row): void { + function write(?array $row, ?array $rowStyle=null): void { $row = $this->cookRow($row); if ($row === null) return; $this->writeHeaders(array_keys($row)); - $this->_write($row); + $this->_write($row, $rowStyle); } - function writeAll(?iterable $rows=null): void { + function writeAll(?iterable $rows=null, ?array $rowStyle=null): void { $unsetRows = false; if ($rows === null) { $rows = $this->rows; @@ -116,7 +116,7 @@ abstract class AbstractBuilder extends TempStream implements IBuilder { } if ($rows !== null) { foreach ($rows as $row) { - $this->write(cl::with($row)); + $this->write(cl::with($row), $rowStyle); } } if ($unsetRows) $this->rows = null;