Skip to content
This repository was archived by the owner on May 26, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Spout/Writer/ODS/Manager/WorksheetManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ private function getCellXML(Cell $cell, $styleIndex, $numTimesValueRepeated)
} elseif ($cell->isEmpty()) {
$data .= '/>';
} else {
throw new InvalidArgumentException('Trying to add a value with an unsupported type: ' . \gettype($cell->getValue()));
$value = $cell->getValueEvenIfError();

throw new InvalidArgumentException('Trying to add a value with an unsupported type: ' . (\is_object($value) ? \get_class($value) : \gettype($value)));
}

return $data;
Expand Down
4 changes: 3 additions & 1 deletion src/Spout/Writer/XLSX/Manager/WorksheetManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ private function getCellXML($rowIndexOneBased, $columnIndexZeroBased, Cell $cell
$cellXML = '';
}
} else {
throw new InvalidArgumentException('Trying to add a value with an unsupported type: ' . \gettype($cell->getValue()));
$value = $cell->getValueEvenIfError();

throw new InvalidArgumentException('Trying to add a value with an unsupported type: ' . (\is_object($value) ? \get_class($value) : \gettype($value)));
Comment thread
andrew-demb marked this conversation as resolved.
Outdated
}

return $cellXML;
Expand Down