src/Command/GenerateCommand.php
protected function outputCsv(InputInterface $input, OutputInterface $output, $data)
	{
		$delimiter = $input->getOption('delimiter');
		$enclosure = $input->getOption('enclosure');

		$stream = fopen('php://temp', 'w+');

		foreach ($data as $row) {
			if ($enclosure === null) {
				fputcsv($stream, $this->flattenArray($row), $delimiter);
			}
			else {
				fputcsv($stream, $this->flattenArray($row), $delimiter, $enclosure);
			}
		}

		fseek($stream, 0);
		$csv = stream_get_contents($stream);
		$output->write($csv);
	}
protected function outputCsv(InputInterface $input, OutputInterface $output, $data)
	{
		$delimiter = $input->getOption('delimiter');
		$enclosure = $input->getOption('enclosure');

		$stream = fopen('php://temp', 'w+');

		foreach ($data as $row) {
			if ($enclosure === null) {
				fputcsv($stream, $this->flattenArray($row), $delimiter);
			}
			else {
				fputcsv($stream, $this->flattenArray($row), $delimiter, $enclosure);
			}
		}

		fseek($stream, 0);
		$csv = stream_get_contents($stream);
		$output->write($csv);
	}
Generate and output the data as CSV.

@param OutputInterface $output
@param mixed           $data