Merge e2609c9bef0f45b54cd9b60200f7c511f5df7c16 into 84596668410bea89d21aa9867b91e1550e359329

This commit is contained in:
Andrii Dembitskyi 2022-05-26 15:55:26 +02:00 committed by GitHub
commit 7aad52af4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

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

View File

@ -246,7 +246,14 @@ EOD;
$cellXML = ''; $cellXML = '';
} }
} else { } 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; return $cellXML;