FOS\UserBundle\Command\DemoteSuperAdminCommand::interact PHP Method

interact() protected method

See also: Command
protected interact ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    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);
        }
    }
DemoteSuperAdminCommand