Goetas\Xsd\XsdToPhp\Command\ConvertToPHP::convert PHP Method

convert() protected method

protected convert ( AbstractConverter $converter, array $schemas, array $targets, Symfony\Component\Console\Output\OutputInterface $output )
$converter Goetas\Xsd\XsdToPhp\AbstractConverter
$schemas array
$targets array
$output Symfony\Component\Console\Output\OutputInterface
    protected function convert(AbstractConverter $converter, array $schemas, array $targets, OutputInterface $output)
    {
        $generator = new ClassGenerator();
        $pathGenerator = new Psr4PathGenerator($targets);
        $items = $converter->convert($schemas);
        $progress = new ProgressBar($output, count($items));
        $progress->start();
        foreach ($items as $item) {
            $progress->advance();
            $output->write(" Creating <info>" . $output->getFormatter()->escape($item->getFullName()) . "</info>... ");
            $path = $pathGenerator->getPath($item);
            $fileGen = new FileGenerator();
            $fileGen->setFilename($path);
            $classGen = new \Zend\Code\Generator\ClassGenerator();
            if ($generator->generate($classGen, $item)) {
                $fileGen->setClass($classGen);
                $fileGen->write();
                $output->writeln("done.");
            } else {
                $output->write("skip.");
            }
        }
    }