From db50c6080e121763b7fa9fde596a65eb6294fa5c Mon Sep 17 00:00:00 2001 From: Thijs De Paepe Date: Thu, 26 Dec 2019 14:58:40 +0100 Subject: [PATCH] Csv::Parser removed processor --- src/Component/Csv/Reader/CsvParser.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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; } /**