Preserve classname and PHP type together in error message
This commit is contained in:
parent
aef099faf3
commit
c7f2612685
@ -245,7 +245,12 @@ class WorksheetManager implements WorksheetManagerInterface
|
||||
} else {
|
||||
$value = $cell->getValueEvenIfError();
|
||||
|
||||
throw new InvalidArgumentException('Trying to add a value with an unsupported type: ' . (\is_object($value) ? \get_class($value) : \gettype($value)));
|
||||
$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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user