Use original cell value event if cell contain error to generate more helpful exception message (in case of objects, for example)

This commit is contained in:
Andrii Dembitskyi 2021-06-22 16:15:40 +03:00
parent 1a06aa624d
commit 8b3b832359
2 changed files with 2 additions and 2 deletions

View File

@ -243,7 +243,7 @@ class WorksheetManager implements WorksheetManagerInterface
} elseif ($cell->isEmpty()) {
$data .= '/>';
} else {
$value = $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)));
}

View File

@ -253,7 +253,7 @@ EOD;
$cellXML = '';
}
} else {
$value = $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)));
}