protected function interact(InputInterface $input, OutputInterface $output) { if (!$input->getArgument('username')) { $username = $this->getHelper('dialog')->askAndValidate($output, 'Please choose a username:', function ($username) { if (empty($username)) { throw new \Exception('Username can not be empty'); } return $username; }); $input->setArgument('username', $username); } }
/** * @see Command */ protected function interact(InputInterface $input, OutputInterface $output) { /** @var UserDiscriminatorInterface $discriminator */ $discriminator = $this->getContainer()->get('rollerworks_multi_user.user_discriminator'); $discriminator->setCurrentUser($input->getOption('user-system')); parent::interact($input, $output); }