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

outputVprintf() protected method

Generate and output the data as PHP.
protected outputVprintf ( 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 outputVprintf(InputInterface $input, OutputInterface $output, $data)
    {
        $pattern = $input->getOption('pattern');
        $enclosure = $input->getOption('enclosure');
        $escape = $input->getOption('escape');
        foreach ($data as $values) {
            $values = $this->flattenArray((array) $values);
            if ($enclosure) {
                foreach ($values as $key => $value) {
                    $values[$key] = $enclosure . str_replace($enclosure, $escape . $enclosure, $value) . $enclosure;
                }
            }
            $output->writeln(vsprintf($pattern, $values));
        }
    }