Author: Jean-François Simon (contact@jfsimon.fr)
Inheritance: extends Symfony\Component\Console\Descriptor\Descriptor
Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function handle(Args $args, IO $io, Command $command)
 {
     $descriptor = new JsonDescriptor();
     $output = new IOOutput($io);
     $application = $command->getApplication();
     $applicationAdapter = new ApplicationAdapter($application);
     if ($args->isArgumentSet('command')) {
         $theCommand = $application->getCommand($args->getArgument('command'));
         $commandAdapter = new CommandAdapter($theCommand, $applicationAdapter);
         $descriptor->describe($output, $commandAdapter);
     } else {
         $descriptor->describe($output, $applicationAdapter);
     }
     return 0;
 }