Skip to content

Commit

Permalink
Csv::Parser removed processor
Browse files Browse the repository at this point in the history
  • Loading branch information
Thijzer committed Dec 26, 2019
1 parent aa41535 commit db50c60
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Component/Csv/Reader/CsvParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '\\';
Expand All @@ -36,7 +34,6 @@ public function __construct(
\SplFileObject::DROP_NEW_LINE
);
$file->setCsvControl($delimiter, $enclosure, $escapeChar);
$this->processor = new NullDataProcessor();

$this->setHeaders();
}
Expand Down Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit db50c60

Please sign in to comment.