You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 26, 2022. It is now read-only.
I'm using version 3.3.0.
I experienced this exception and I've seen it reported in another ticket #713 where someone tried to pass an array as value to a cell entity:
"Trying to add a value with an unsupported type: NULL"
The wrong type is reported because
Box\Spout\Common\Entity->getValue() has this line: return !$this->isError() ? $this->value : null;
and Box\Spout\Writer\XLSX\Manager->getCellXML() throws the exception doing this: throw new InvalidArgumentException('Trying to add a value with an unsupported type: ' . \gettype($cell->getValue()));
so of course it'll always report NULL as type.
So perhaps the cell's getValue() should return the actual value even if it is an unsupported type, but everything reading the cell should check isError() first. That's one way. Another way would be to to create another version of getValue() by another name (e.g. getActualValue()) and use that in the exception message.
That'll save users a lot of confusion.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm using version 3.3.0.
I experienced this exception and I've seen it reported in another ticket #713 where someone tried to pass an array as value to a cell entity:
"Trying to add a value with an unsupported type: NULL"
The wrong type is reported because
Box\Spout\Common\Entity->getValue() has this line:
return !$this->isError() ? $this->value : null;
and Box\Spout\Writer\XLSX\Manager->getCellXML() throws the exception doing this:
throw new InvalidArgumentException('Trying to add a value with an unsupported type: ' . \gettype($cell->getValue()));
so of course it'll always report NULL as type.
So perhaps the cell's getValue() should return the actual value even if it is an unsupported type, but everything reading the cell should check isError() first. That's one way. Another way would be to to create another version of getValue() by another name (e.g. getActualValue()) and use that in the exception message.
That'll save users a lot of confusion.
The text was updated successfully, but these errors were encountered: