More tests, filtering iterator, cleanup
This commit is contained in:
@ -45,12 +45,16 @@ class CsvReader implements ReaderInterface
|
||||
|
||||
private function loadData(array $data)
|
||||
{
|
||||
// FIXME parse data according to directives if present
|
||||
$separator = $this->options['separator']??',';
|
||||
$enclosure = $this->options['enclosure']??'"';
|
||||
$escape = $this->options['escape']??"\\";
|
||||
|
||||
|
||||
$head = str_getcsv(array_shift($data));
|
||||
$this->data = [];
|
||||
foreach ($data as $row) {
|
||||
if ($row) {
|
||||
$row = str_getcsv($row);
|
||||
$row = str_getcsv($row, $separator, $enclosure, $escape);
|
||||
$this->data[] = array_combine($head, $row);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user