Handle invalid (object) value in cell value while generating exception message - add classname to message

This commit is contained in:
Andrii Dembitskyi committed 2021-06-22 16:15:32 +03:00
1 parent 9533accd73
commit 1a06aa624d
2 files changed
+6 -2

No files matched your search

@@ -243,7 +243,9 @@ class WorksheetManager implements WorksheetManagerInterface
} elseif ($cell->isEmpty()) {
$data .= '/>';
} else {
throw new InvalidArgumentException('Trying to add a value with an unsupported type: ' . \gettype($cell->getValue()));
$value = $cell->getValue();
throw new InvalidArgumentException('Trying to add a value with an unsupported type: ' . (\is_object($value) ? \get_class($value) : \gettype($value)));
}
return $data;