From c698aa3a2b3152eaebc89bbd3054d1bcfedce27f Mon Sep 17 00:00:00 2001 From: DC* Date: Thu, 2 Oct 2014 00:17:20 -0300 Subject: [PATCH] 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. --- src/Composer/Command/InitCommand.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Composer/Command/InitCommand.php b/src/Composer/Command/InitCommand.php index 8aa734630..f92615f7b 100644 --- a/src/Composer/Command/InitCommand.php +++ b/src/Composer/Command/InitCommand.php @@ -228,10 +228,7 @@ EOT $output, $dialog->getQuestion('Author', $author), function ($value) use ($self, $author) { - if (null === $value) { - return $author; - } - + $value = $value ?: $author; $author = $self->parseAuthorString($value); return sprintf('%s <%s>', $author['name'], $author['email']);