diff --git a/src/Component/Csv/Reader/CsvParser.php b/src/Component/Csv/Reader/CsvParser.php index d0d5b2d9..28b4934c 100644 --- a/src/Component/Csv/Reader/CsvParser.php +++ b/src/Component/Csv/Reader/CsvParser.php @@ -8,10 +8,8 @@ use Misery\Component\Common\Processor\ProcessorAwareTrait; use Misery\Component\Csv\Exception\InvalidCsvElementSizeException; -class CsvParser implements CsvInterface, CursorInterface, ProcessorAwareInterface +class CsvParser implements CsvInterface, CursorInterface { - use ProcessorAwareTrait; - public const DELIMITER = ';'; public const ENCLOSURE = '"'; public const ESCAPE = '\\'; @@ -36,7 +34,6 @@ public function __construct( \SplFileObject::DROP_NEW_LINE ); $file->setCsvControl($delimiter, $enclosure, $escapeChar); - $this->processor = new NullDataProcessor(); $this->setHeaders(); } @@ -102,11 +99,11 @@ public function current() // here we need to use the filter $row = @array_combine($this->headers, $current); - if (null === $row) { + if (false === $row || null === $row) { throw new InvalidCsvElementSizeException($this->file->getFilename(), $this->key()); } - return $this->processor->processRow($row); + return $row; } /**