protected function getAdminInformation(InputInterface $input, OutputInterface $output)
    {
        $admin = array();

        /**
         * @var \Symfony\Component\Console\Helper\DialogHelper
         */
        $dialog = $this->getHelperSet()->get('dialog');

        // Function to validate mail address.
        $mailValidator = function ($answer) {
            if (!filter_var($answer, FILTER_VALIDATE_EMAIL)) {
                throw new \InvalidArgumentException(Lang::get('must_be_valid_email'));
            }

            return $answer;
        };

        if ($adminEmail = $input->getOption('admin-mail')) {
            $adminEmail = $mailValidator($adminEmail);
        } else {
            $adminEmail = $dialog->askAndValidate($output, Lang::get('enter_email'), $mailValidator, false);
        }
        if (!$adminName = $input->getOption('admin-name')) {
            $adminName = $dialog->ask($output, Lang::get('enter_name'));
        }
        if (!$adminPass = $input->getOption('admin-pass')) {
            $adminPass = $dialog->askHiddenResponse($output, Lang::get('enter_password'));
        }

        $admin['mail'] = $adminEmail;
        $admin['name'] = $adminName;
        $admin['pass'] = $adminPass;

        return $admin;
    }
protected function getAdminInformation(InputInterface $input, OutputInterface $output)
    {
        $admin = array();

        /**
         * @var \Symfony\Component\Console\Helper\DialogHelper
         */
        $dialog = $this->getHelperSet()->get('dialog');

        // Function to validate mail address.
        $mailValidator = function ($answer) {
            if (!filter_var($answer, FILTER_VALIDATE_EMAIL)) {
                throw new \InvalidArgumentException(Lang::get('must_be_valid_email'));
            }

            return $answer;
        };

        if ($adminEmail = $input->getOption('admin-mail')) {
            $adminEmail = $mailValidator($adminEmail);
        } else {
            $adminEmail = $dialog->askAndValidate($output, Lang::get('enter_email'), $mailValidator, false);
        }
        if (!$adminName = $input->getOption('admin-name')) {
            $adminName = $dialog->ask($output, Lang::get('enter_name'));
        }
        if (!$adminPass = $input->getOption('admin-pass')) {
            $adminPass = $dialog->askHiddenResponse($output, Lang::get('enter_password'));
        }

        $admin['mail'] = $adminEmail;
        $admin['name'] = $adminName;
        $admin['pass'] = $adminPass;

        return $admin;
    }
protected function getAdminInformation ( InputInterface $ input , OutputInterface $ output ) { $ admin = array ( ) ; /**
         * @var \Symfony\Component\Console\Helper\DialogHelper
         */ $ dialog = $ this -> getHelperSet ( ) -> get ( 'dialog' ) ; // Function to validate mail address. $ mailValidator = function ( $ answer ) { if ( ! filter_var ( $ answer , FILTER_VALIDATE_EMAIL ) ) { throw new \ InvalidArgumentException ( Lang :: get ( 'must_be_valid_email' ) ) ; } return $ answer ; } ; if ( $ adminEmail = $ input -> getOption ( 'admin-mail' ) ) { $ adminEmail = $ mailValidator ( $ adminEmail ) ; } else { $ adminEmail = $ dialog -> askAndValidate ( $ output , Lang :: get ( 'enter_email' ) , $ mailValidator , false ) ; } if ( ! $ adminName = $ input -> getOption ( 'admin-name' ) ) { $ adminName = $ dialog -> ask ( $ output , Lang :: get ( 'enter_name' ) ) ; } if ( ! $ adminPass = $ input -> getOption ( 'admin-pass' ) ) { $ adminPass = $ dialog -> askHiddenResponse ( $ output , Lang :: get ( 'enter_password' ) ) ; } $ admin [ 'mail' ] = $ adminEmail ; $ admin [ 'name' ] = $ adminName ; $ admin [ 'pass' ] = $ adminPass ; return $ admin ; }
Load information for admin user form CLI options or ask info to user.

@param InputInterface $input
@param OutputInterface $output
@return array
Load information for admin user form CLI options or ask info to user .