This PR adds a new writeSheetRowWithColTypes
method used to set or override column types while writing row data.
The original column types defined by writeSheetHeader
are retained so that the process can revert back to them after writing the current row's data, allowing the header versions to serve as default definitions for the columns.
Additionally, users can limit the column type override to target specific columns rather than the entire row:
$writer->writeSheetHeader($sheet, ['col1' => 'string', 'col2' => 'integer']);
$writer->writeSheetRow($sheet, ['val1', 1]);
$writer-> writeSheetRowWithColTypes($sheet, ['val2', 'n/a'], [], ['string', 'string']); // override the entire row
$writer-> writeSheetRowWithColTypes($sheet, ['val3', '?'], [], [1 => 'string']); // override col 2 only