Skip to content

Commit 5fdf334

Browse files
Fix error when headers option to Csv resource task is null
1 parent 02161e7 commit 5fdf334

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/Filesystem/CsvResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class CsvResource implements WritableStructuredFileInterface, SeekableFileInterf
4242

4343
protected ?int $lineNumber = 1;
4444

45-
protected bool $closed;
45+
protected bool $closed = false;
4646

4747
protected bool $seekCalled = false;
4848

src/Task/File/Csv/AbstractCsvResourceTask.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,5 @@ protected function configureOptions(OptionsResolver $resolver): void
6363
$resolver->setAllowedTypes('headers', ['null', 'array']);
6464
}
6565

66-
abstract protected function getHeaders(ProcessState $state, array $options): array;
66+
abstract protected function getHeaders(ProcessState $state, array $options): ?array;
6767
}

src/Task/File/Csv/CsvReaderTask.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function next(ProcessState $state): bool
7878
return ! $this->csv->isEndOfFile();
7979
}
8080

81-
protected function getHeaders(ProcessState $state, array $options): array
81+
protected function getHeaders(ProcessState $state, array $options): ?array
8282
{
8383
return $options['headers'];
8484
}

src/Task/File/Csv/CsvWriterTask.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected function getInput(ProcessState $state): array
8585
return $input;
8686
}
8787

88-
protected function getHeaders(ProcessState $state, array $options): array
88+
protected function getHeaders(ProcessState $state, array $options): ?array
8989
{
9090
$headers = $options['headers'];
9191
if ($headers === null) {

0 commit comments

Comments
 (0)