protected function getPluginDescription(InputInterface $input, OutputInterface $output)
{
$validate = function ($description) {
if (empty($description)) {
throw new \RuntimeException('You have to enter a description');
}
if (150 < strlen($description)) {
throw new \RuntimeException('Description is too long, max 150 characters allowed.');
}
return $description;
};
$description = $input->getOption('description');
if (empty($description)) {
$dialog = $this->getHelperSet()->get('dialog');
$description = $dialog->askAndValidate($output, 'Enter a plugin description: ', $validate);
} else {
$validate($description);
}
return $description;
}