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

		foreach ($data as $value) {
			$value = $this->flattenArray($value);
			$value = implode($delimiter, $value);

			if ($enclosure) {
				$value = $enclosure . str_replace($enclosure, $escape . $enclosure, $value) . $enclosure;
			}

			$output->writeln(sprintf($pattern, $value));
		}
	}
protected function outputPrintf(InputInterface $input, OutputInterface $output, $data)
	{
		$pattern   = $input->getOption('pattern');
		$delimiter = $input->getOption('delimiter');
		$enclosure = $input->getOption('enclosure');
		$escape    = $input->getOption('escape');

		foreach ($data as $value) {
			$value = $this->flattenArray($value);
			$value = implode($delimiter, $value);

			if ($enclosure) {
				$value = $enclosure . str_replace($enclosure, $escape . $enclosure, $value) . $enclosure;
			}

			$output->writeln(sprintf($pattern, $value));
		}
	}
Generate and output the data as PHP.

@param OutputInterface $output
@param mixed           $data