From e61a56b0b78efbb06128df01a6661827e4acdadb Mon Sep 17 00:00:00 2001 From: fab2s Date: Wed, 16 Nov 2022 15:03:56 +0100 Subject: [PATCH] Allow header override --- src/Extractors/File/CsvExtractor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Extractors/File/CsvExtractor.php b/src/Extractors/File/CsvExtractor.php index 91f87e7..13fb25f 100644 --- a/src/Extractors/File/CsvExtractor.php +++ b/src/Extractors/File/CsvExtractor.php @@ -75,8 +75,8 @@ protected function readHeader(): ?array return null; } - if ($this->useHeader && !isset($this->header)) { - $this->header = array_map('trim', $firstRecord); + if ($this->useHeader) { + $this->header = $this->header ?? array_map('trim', $firstRecord); return $this->getNextNonEmptyRecord(); }