public dumpFromInput ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output, |
||
$input | Symfony\Component\Console\Input\InputInterface | |
$output | Symfony\Component\Console\Output\OutputInterface | |
$collection |
public function dumpFromInput(InputInterface $input, OutputInterface $output, SuiteCollection $collection)
{
if (false === $input->getOption('dump-file') && false === $input->getOption('dump')) {
return;
}
$dom = $this->xmlEncoder->encode($collection);
if ($dumpFile = $input->getOption('dump-file')) {
$xml = $dom->dump();
file_put_contents($dumpFile, $xml);
$output->writeln('Dumped result to ' . $dumpFile);
}
if ($input->getOption('dump')) {
$xml = $dom->dump();
$output->write($xml);
}
}