Task/File/Csv/CsvWriterTask.php
public function execute(ProcessState $state)
    {
        if (!$this->csv instanceof CsvFile) {
            $this->initFile($state);
            if ($this->getOption($state, 'write_headers') && 0 === filesize($this->csv->getFilePath())) {
                $this->csv->writeHeaders();
            }
        }
        $this->csv->writeLine($this->getInput($state));
    }
public function execute(ProcessState $state)
    {
        if (!$this->csv instanceof CsvFile) {
            $this->initFile($state);
            if ($this->getOption($state, 'write_headers') && 0 === filesize($this->csv->getFilePath())) {
                $this->csv->writeHeaders();
            }
        }
        $this->csv->writeLine($this->getInput($state));
    }
@param ProcessState $state

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