Preserve classname and PHP type together in error message
Co-authored-by: Adrien Loison <adrilo@users.noreply.github.com>
This commit is contained in:
parent
8b3b832359
commit
aef099faf3
@ -255,7 +255,12 @@ EOD;
|
||||
} 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 $cellXML;
|
||||
|
Loading…
x
Reference in New Issue
Block a user