/**
  * {@inheritDoc}
  *
  * @param InputInterface $input
  * @param OutputInterface $output
  * @return int
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     /** @var DialogHelper $dialog */
     $dialog = $this->getHelperSet()->get('dialog');
     $wsdl = Validators::validateWsdl($input->getOption('wsdl'));
     $dir = Validators::validateTargetDir($input->getOption('dir'));
     $namespace = Validators::validateNamespace($input->getOption('namespace'));
     $licensePath = Validators::validateLicensePath($input->getOption('license-path'));
     if ($input->isInteractive()) {
         $this->writeSection($output, array(sprintf('Path to the wsdl file: "%s"', $wsdl), sprintf('The directory where to create proxy classes: "%s"', $dir), sprintf('The namespace of proxy classes to create: "%s"', $namespace)));
         if (!$dialog->askConfirmation($output, $this->getQuestion('Do you confirm generation', 'yes', '?'), true)) {
             $output->writeln('<error>Command aborted</error>');
             return 1;
         }
     }
     $generator = new SimpleTypeAbstractGenerator($wsdl, $dir . 'SimpleType', $namespace . '\\SimpleType', array(), $licensePath);
     $generator->execute();
     $generator = new ComplexTypeAbstractGenerator($wsdl, $dir . 'ComplexType', $namespace . '\\ComplexType', array($namespace . '\\SimpleType'), $licensePath);
     $generator->execute();
     $generator = new SimpleTypeGenerator($wsdl, $dir . 'SimpleType', $namespace . '\\SimpleType', array(), $licensePath);
     $generator->execute();
     $generator = new ComplexTypeGenerator($wsdl, $dir . 'ComplexType', $namespace . '\\ComplexType', array($namespace . '\\SimpleType'), $licensePath);
     $generator->execute();
     $generator = new SoapClientGenerator($wsdl, $dir, $namespace, array('RuntimeException', 'SoapFault', 'SoapClient as BaseSoapClient'), $licensePath);
     $generator->execute();
     $generator = new SoapServiceGenerator($wsdl, $dir, $namespace, array('RuntimeException', 'SoapFault', 'SoapClient as BaseSoapClient', 'InvalidArgumentException'), $licensePath);
     $generator->execute();
     unset($generator);
 }
コード例 #2
0
 /**
  * @depends testComplexTypeAbstractGenerator
  */
 public function testComplexTypeGenerator()
 {
     $generator = new ComplexTypeGenerator(self::$wsdlPath, self::$exportPath . '/ComplexType', self::$namespace . '\\ComplexType', array(self::$namespace . '\\SimpleType'), self::$licensePath);
     $generator->execute();
     $this->exampleDetailTest();
     $this->arrayExampleTest();
     $this->detailTest();
     $this->replyTest();
     $this->requestTest();
 }