This commit is contained in:
Andrii Dembitskyi authored and GitHub committed 2022-05-26 15:55:26 +02:00
commit 7aad52af4a
2 files changed
+16 -2

No files matched your search

@@ -243,7 +243,14 @@ 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->getValueEvenIfError();
$errorMessage = 'Trying to add a value with an unsupported type: ' . \gettype($value);
if (\is_object($value)) {
$errorMessage .= ' (' . \get_class($value) . ' given)';
}
throw new InvalidArgumentException($errorMessage);
}
return $data;
@@ -246,7 +246,14 @@ EOD;
$cellXML = '';
}
} else {
throw new InvalidArgumentException('Trying to add a value with an unsupported type: ' . \gettype($cell->getValue()));
$value = $cell->getValueEvenIfError();
$errorMessage = 'Trying to add a value with an unsupported type: ' . \gettype($value);
if (\is_object($value)) {
$errorMessage .= ' (' . \get_class($value) . ' given)';
}
throw new InvalidArgumentException($errorMessage);
}
return $cellXML;