private function getSettingsType(InputInterface $input, OutputInterface $output)
{
$availableTypes = $this->getSettingTypes();
$validate = function ($type) use($availableTypes) {
if (empty($type) || !in_array($type, $availableTypes)) {
throw new \InvalidArgumentException('Please enter a valid settings type (' . implode(', ', $availableTypes) . '). ');
}
return $type;
};
$settingsType = $input->getOption('settingstype');
if (empty($settingsType)) {
$dialog = $this->getHelperSet()->get('dialog');
$settingsType = $dialog->askAndValidate($output, 'Please choose the type of settings you want to create (' . implode(', ', $availableTypes) . '): ', $validate, false, null, $availableTypes);
} else {
$validate($settingsType);
}
return ucfirst($settingsType) . 'Settings';
}