* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ class ParseCommand extends Command { /** @var \PSX\Api\ApiManager */ protected $apiManager; /** @var \PSX\Api\GeneratorFactoryInterface */ protected $factory; public function __construct(ApiManager $apiManager, GeneratorFactoryInterface $factory) { parent::__construct(); $this->apiManager = $apiManager; $this->factory = $factory; } protected function configure() { $this ->setName('api:parse') ->setDescription('Parses an arbitrary source and outputs the schema in a specific format') ->addArgument('source', InputArgument::REQUIRED, 'The schema source this is either a absolute class name or schema file') ->addArgument('path', InputArgument::REQUIRED, 'The path of the resource') ->addOption('format', 'f', InputOption::VALUE_REQUIRED, 'Optional the output format possible values are: ' . implode(', ', GeneratorFactory::getPossibleTypes())) ->addOption('config', 'c', InputOption::VALUE_REQUIRED, 'Optional a config value which gets passed to the generator'); } protected function execute(InputInterface $input, OutputInterface $output) { $resource = $this->apiManager->getApi($input->getArgument('source'), $input->getArgument('path')); $generator = $this->factory->getGenerator($input->getOption('format'), $input->getOption('config')); $response = $generator->generate($resource); OutputWriter::write($response, $output); return 0; } } __halt_compiler();----SIGNATURE:----BgDNziz2mGcsfVq7BsczdE9i09vQCCo58OF40FFZL7AR2BgbtfMO4J+aw60Z0pi0IpZEfzRVFe5IpTMBro5zgbyy/5qZZISXHhSQxXyL3shJlQ3MRYeOANtKV7VGxWQn60S3sNmdf45s7itD7h1NEmqcZt8zQX+xZn/BpMZiPlUoNMlQoeFyxUUvpnakxwnakbxBYGeKYF4KFJHVMC5vEH7muUndNgCkY64/pACcvlap5qoxZeLG9haKVU8LxPd8e+mXz9FkCydm3HEBD6Lg0djmKmFpM11AHdhrrCDXts3eODFdjUp5Pp6Sx2KEpJKXFI9A8RhfNo3tsuig18VwR7eG4Zr5+pDDtX7c/cAui3GAXvS3Ptth/ieB7+y24RhVCbEsx3bTdJk8KLnBMRWF8FLNQtzUvEtzp0lgMaG3qrdmwcRWKQnqbBzC6NPXWNT3oJMlR2Ds8ym9v5IhwfQtaaHWCdeAmYpsOz2UvQnrdaxFD+HCY7LPYfarKJ0m6K+sqb9jnzHOVzcjzniBHdbNYuMboOKaSl9P/unds2Il5lA3L8It0vIyszNttiYhDw8oALxzLl8Pq05K61lkJwAnefpF543Ms5sqgEv6CUZkqV+Is4sQvWuWHPV9UtSZHP1GVVu/UhEUeFv0fWqXUHLqFCtD2FsJDaoIVtf8U0U0gD4=----ATTACHMENT:----MTIxMTI2NDQ4ODQzOTY5IDY1NzUxNjE1OTA1MDQ0NDQgNTIwNTkzOTkwNjExMjU2Nw==