Skip to content

Commit 35b1176

Browse files
committed
Merge pull request #2 from QuorumCollection/donatj-patch-1
Update DataSheet.php to Allow Nulls
2 parents 2fb33c3 + 1f8931a commit 35b1176

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/DataSheet.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ public function addRows( $dataSet ) {
5353
* @param array $row
5454
*/
5555
public function addRow( array $row ) {
56-
foreach( $row as $col ) {
57-
if( !is_scalar($col) ) {
56+
foreach( $row as &$col ) {
57+
if( !is_scalar($col) && !is_null($col) ) {
5858
throw new InvalidDataTypeException;
5959
}
60+
61+
$col = (string)$col;
6062
}
6163

6264
fwrite($this->tmpStream, json_encode($row) . "\n");

0 commit comments

Comments
 (0)