Bit3\FakerCli\Command\GenerateCommand::outputPrintf PHP Method

outputPrintf() protected method

Generate and output the data as PHP.
protected outputPrintf ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output, mixed $data )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
$data mixed
    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));
        }
    }