Fix missing validation on default value for author input
The default author value on the composer init command is not validated against `parseAuthorString` method and thus not being re-prompted, finally throwing an InvalidArgumentException when it tries to generate the composer.json file. The changes forces the validation of both the entered author string or the default value.pull/3319/head
parent
b33da336ec
commit
c698aa3a2b
|
@ -228,10 +228,7 @@ EOT
|
||||||
$output,
|
$output,
|
||||||
$dialog->getQuestion('Author', $author),
|
$dialog->getQuestion('Author', $author),
|
||||||
function ($value) use ($self, $author) {
|
function ($value) use ($self, $author) {
|
||||||
if (null === $value) {
|
$value = $value ?: $author;
|
||||||
return $author;
|
|
||||||
}
|
|
||||||
|
|
||||||
$author = $self->parseAuthorString($value);
|
$author = $self->parseAuthorString($value);
|
||||||
|
|
||||||
return sprintf('%s <%s>', $author['name'], $author['email']);
|
return sprintf('%s <%s>', $author['name'], $author['email']);
|
||||||
|
|
Loading…
Reference in New Issue