original_string: protected function buildCommand(CommandPluginInterface $commandPlugin)
      {
          $definition = $commandPlugin->getCommandDefinition();
          $argumentsAndOptions = [];
  
          $consoleComand = new Command($definition->getName());
          $consoleComand->setDescription($definition->getDescription());
          $consoleComand->setHelp($definition->getHelp());
  
          foreach ($definition->getArguments() as list($name, $mode, $description, $defaultValue)) {
              $argumentsAndOptions[] = new InputArgument($name, $mode, $description, $defaultValue);
          }
  
          foreach ($definition->getOptions() as list($name, $shortcut, $mode, $description, $defaultValue)) {
              $argumentsAndOptions[] = new InputOption($name, $shortcut, $mode, $description, $defaultValue);
          }
  
          $consoleComand->setDefinition($argumentsAndOptions);
          $consoleComand->setCode(function (InputInterface $input, OutputInterface $output) use ($commandPlugin, $consoleComand) {
              $io = new ConsoleIO($input, $output);
              $arguments = $input->getArguments();
              $options = $input->getOptions();
  
              $commandPlugin->setCommandEnvironment(new SymfonyCommandEnvironment($consoleComand, $output));
              $commandPlugin->executeCommand($io, $arguments, $options);
          });
  
          return $consoleComand;
      }
code: protected function buildCommand(CommandPluginInterface $commandPlugin)
      {
          $definition = $commandPlugin->getCommandDefinition();
          $argumentsAndOptions = [];
  
          $consoleComand = new Command($definition->getName());
          $consoleComand->setDescription($definition->getDescription());
          $consoleComand->setHelp($definition->getHelp());
  
          foreach ($definition->getArguments() as list($name, $mode, $description, $defaultValue)) {
              $argumentsAndOptions[] = new InputArgument($name, $mode, $description, $defaultValue);
          }
  
          foreach ($definition->getOptions() as list($name, $shortcut, $mode, $description, $defaultValue)) {
              $argumentsAndOptions[] = new InputOption($name, $shortcut, $mode, $description, $defaultValue);
          }
  
          $consoleComand->setDefinition($argumentsAndOptions);
          $consoleComand->setCode(function (InputInterface $input, OutputInterface $output) use ($commandPlugin, $consoleComand) {
              $io = new ConsoleIO($input, $output);
              $arguments = $input->getArguments();
              $options = $input->getOptions();
  
              $commandPlugin->setCommandEnvironment(new SymfonyCommandEnvironment($consoleComand, $output));
              $commandPlugin->executeCommand($io, $arguments, $options);
          });
  
          return $consoleComand;
      }
code_tokens: protected function buildCommand ( CommandPluginInterface $ commandPlugin ) { $ definition = $ commandPlugin -> getCommandDefinition ( ) ; $ argumentsAndOptions = [ ] ; $ consoleComand = new Command ( $ definition -> getName ( ) ) ; $ consoleComand -> setDescription ( $ definition -> getDescription ( ) ) ; $ consoleComand -> setHelp ( $ definition -> getHelp ( ) ) ; foreach ( $ definition -> getArguments ( ) as list ( $ name , $ mode , $ description , $ defaultValue ) ) { $ argumentsAndOptions [ ] = new InputArgument ( $ name , $ mode , $ description , $ defaultValue ) ; } foreach ( $ definition -> getOptions ( ) as list ( $ name , $ shortcut , $ mode , $ description , $ defaultValue ) ) { $ argumentsAndOptions [ ] = new InputOption ( $ name , $ shortcut , $ mode , $ description , $ defaultValue ) ; } $ consoleComand -> setDefinition ( $ argumentsAndOptions ) ; $ consoleComand -> setCode ( function ( InputInterface $ input , OutputInterface $ output ) use ( $ commandPlugin , $ consoleComand ) { $ io = new ConsoleIO ( $ input , $ output ) ; $ arguments = $ input -> getArguments ( ) ; $ options = $ input -> getOptions ( ) ; $ commandPlugin -> setCommandEnvironment ( new SymfonyCommandEnvironment ( $ consoleComand , $ output ) ) ; $ commandPlugin -> executeCommand ( $ io , $ arguments , $ options ) ; } ) ; return $ consoleComand ; }
docstring: Build a Symfony Console commands.
  
  @param \Yosymfony\Spress\Plugin\CommandPluginInterface $commandPlugin
  
  @return \Symfony\Component\Console\Command\Command Symfony Console command
docstring_tokens: Build a Symfony Console commands .