PhpBench\Console\Command\Handler\DumpHandler::dumpFromInput PHP 메소드

dumpFromInput() 공개 메소드

public dumpFromInput ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output, SuiteCollection $collection )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
$collection PhpBench\Model\SuiteCollection
    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);
        }
    }