Add the ability to pass an array with various keys to addRows() (#240)

This commit is contained in:
Pavel Zyukin authored and Adrien Loison committed 2016-06-03 08:09:37 -07:00
1 parent 1d3a9f939c
commit 70c81e809f
1 file changed
+2 -1
+2 -1
View File
@@ -238,7 +238,8 @@ abstract class AbstractWriter implements WriterInterface
public function addRows(array $dataRows) public function addRows(array $dataRows)
{ {
if (!empty($dataRows)) { if (!empty($dataRows)) {
if (!is_array($dataRows[0])) { $firstRow = reset($dataRows);
if (!is_array($firstRow)) {
throw new InvalidArgumentException('The input should be an array of arrays'); throw new InvalidArgumentException('The input should be an array of arrays');
} }