Task/File/Csv/CsvReaderTask.php
public function execute(ProcessState $state)
    {
        $output = null;
        if ($this->csv instanceof CsvFile
            && $this->csv->getFilePath() !== $this->getOption($state, 'file_path')) {
            $this->csv = null;
        }

        if (!$this->csv instanceof CsvFile) {
            $this->initFile($state);
        }
        $output = $this->csv->readLine();

        if (null === $output) {
            if ($this->getOption($state, 'log_empty_lines')) {
                $logContext = [
                    'csv_file' => $this->csv->getFilePath(),
                    'csv_line' => $this->csv->getCurrentLine(),
                ];
                $this->logger->warning("Empty line detected at line: {$this->csv->getCurrentLine()}", $logContext);
            }

            $state->setSkipped(true);
        }

        $state->addErrorContextValue('csv_file', $this->csv->getFilePath());
        $state->addErrorContextValue('csv_line', $this->csv->getCurrentLine());
        $state->setOutput($output);
    }
public function execute(ProcessState $state)
    {
        $output = null;
        if ($this->csv instanceof CsvFile
            && $this->csv->getFilePath() !== $this->getOption($state, 'file_path')) {
            $this->csv = null;
        }

        if (!$this->csv instanceof CsvFile) {
            $this->initFile($state);
        }
        $output = $this->csv->readLine();

        if (null === $output) {
            if ($this->getOption($state, 'log_empty_lines')) {
                $logContext = [
                    'csv_file' => $this->csv->getFilePath(),
                    'csv_line' => $this->csv->getCurrentLine(),
                ];
                $this->logger->warning("Empty line detected at line: {$this->csv->getCurrentLine()}", $logContext);
            }

            $state->setSkipped(true);
        }

        $state->addErrorContextValue('csv_file', $this->csv->getFilePath());
        $state->addErrorContextValue('csv_line', $this->csv->getCurrentLine());
        $state->setOutput($output);
    }
@param ProcessState $state

@throws \UnexpectedValueException
@throws \RuntimeException
@throws \InvalidArgumentException
@throws \Symfony\Component\OptionsResolver\Exception\ExceptionInterface
@throws \LogicException