Skip to content

Commit fcd5098

Browse files
authored
Return null on blank lines (#21)
1 parent 73b8619 commit fcd5098

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/Iterator/InitFamilyFileIterator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ protected function getChannelData()
7373
}
7474

7575
if ($index >= (int) $this->options['attribute_data_row']) {
76+
if (count($row) === 0) {
77+
continue;
78+
}
7679
$code = $row[$codeColumn];
7780
if ($code === '') {
7881
continue;

src/Iterator/InitFileIterator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ public function current()
5050
}
5151

5252
$data = $this->trimRight($data);
53+
if (count($data) ===0) {
54+
return null;
55+
}
5356

5457
return $data;
5558
}

0 commit comments

Comments
 (0)