interact() protected méthode

This method is executed before the InputDefinition is validated. This means that this is the only place where the command can interactively ask for values of missing required arguments.
protected interact ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface An InputInterface instance
$output Symfony\Component\Console\Output\OutputInterface An OutputInterface instance
Exemple #1
1
 /**
  * @param InputInterface $input
  * @param OutputInterface $output
  *
  * @throws UnexpectedValueException
  */
 protected function interact(InputInterface $input, OutputInterface $output)
 {
     parent::interact($input, $output);
     if ((int) $input->getOption('ini-php') + (int) $input->getOption('ini-load') + (int) $input->getOption('ini-file') > 1) {
         throw new UnexpectedValueException('Please use only one --ini-* option to set the data source.');
     }
     if ((count($input->getOption('filter-allowed')) > 0) + (count($input->getOption('filter-disallowed')) > 0) > 1) {
         throw new UnexpectedValueException('Please use only one --filter-* option for the data source.');
     }
 }