public function interact(InputInterface $input, OutputInterface $output)
{
$config = [];
if (count($this->authenticationOptions) > 1) {
$authenticationLabels = array_map(function ($value) {
return ucfirst($value[0]);
}, $this->authenticationOptions);
$authenticationType = array_search($this->questionHelper->ask($input, $output, new ChoiceQuestion('Choose ' . $this->label . ' authentication type:', $authenticationLabels, $authenticationLabels[0])), $authenticationLabels, true);
} else {
$authenticationType = 0;
$authenticationLabels = [$this->authenticationOptions[0][0]];
}
$config['authentication'] = [];
$config['authentication']['http-auth-type'] = $this->authenticationOptions[$authenticationType][1];
$config['authentication']['username'] = $this->questionHelper->ask($input, $output, (new Question('Username: '))->setValidator([$this, 'validateNoneEmpty']));
$config['authentication']['password-or-token'] = $this->questionHelper->ask($input, $output, (new Question($authenticationLabels[$authenticationType] . ': '))->setValidator([$this, 'validateNoneEmpty'])->setHidden(true));
$config['base_url'] = $this->questionHelper->ask($input, $output, (new Question(sprintf('Enter your %s api url [%s]: ', $this->label, $this->apiUrl), $this->apiUrl))->setValidator([$this, 'validateUrl']));
$config['repo_domain_url'] = $this->questionHelper->ask($input, $output, (new Question(sprintf('Enter your %s repo url [%s]: ', $this->label, $this->repoUrl), $this->repoUrl))->setValidator([$this, 'validateUrl']));
return $config;
}