[DX] more helpful exception message in case of invalid value
It is should provide a more helpful message for developer in exception, when in cell value provided an object.
Example:
Exception:
Uncaught PHP Exception Box\\Spout\\Common\\Exception\\InvalidArgumentException: \"Trying to add a value with an unsupported type: NULL\" at /project/vendor/box/spout/src/Spout/Writer/XLSX/Manager/WorksheetManager.php line 256
I may assume, that in my code somewhere used null and passed to spout, but the real reason was - object was provided for cell value, and this lead to described above exception.
This PR will improve an error message and provide a better DX.
Hi!
I believe that your interpretation may not be correct. gettype($object) should return "object" and not "NULL" like you describe. Only gettype(null) returns "NULL".
So here, it seems like a NULL value is passed in.
Yes, it was output NULL because $cell->getValue() returned null, but this method return null, because resolved cell type was an error
So PR propose change $cell->getValue() to $cell->getValueEvenIfError() AND explain object class name, when it is contained in value.
Probably Travis CI check should be retried because PR check status was not changed to finished status.