protected function execute(InputInterface $input, OutputInterface $output)
{
$this->input = $input;
$this->output = $output;
$configFile = $this->input->getOption('config');
if (!$configFile || !$this->filesystem->fileExists($configFile)) {
throw InvalidArgumentException::invalidConfigFile();
}
$config = (include $configFile);
if (!$config instanceof ConfigInterface) {
throw InvalidArgumentException::invalidConfigFile();
}
$soapClient = new SoapClient($config->getWsdl(), $config->getSoapOptions());
$typeMap = TypeMap::fromSoapClient($config->getNamespace(), $soapClient);
$generator = new TypeGenerator($config->getRuleSet());
foreach ($typeMap->getTypes() as $type) {
$path = $type->getPathname($config->getDestination());
if ($this->handleType($generator, $type, $path)) {
$this->output->writeln(sprintf('Generated class %s to %s', $type->getFullName(), $path));
}
}
$this->output->writeln('Done');
}