1
0
Fork 0

Allow skipping author, fixes #4969

pull/4974/head
Jordi Boggiano 2016-02-27 16:44:46 +00:00
parent 151774bb58
commit b9a3ef73c0
1 changed files with 5 additions and 1 deletions

View File

@ -174,6 +174,7 @@ EOT
// package names must be in the format foo/bar // package names must be in the format foo/bar
$name = $name . '/' . $name; $name = $name . '/' . $name;
} }
$name = strtolower($name);
} else { } else {
if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}', $name)) { if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}', $name)) {
throw new \InvalidArgumentException( throw new \InvalidArgumentException(
@ -217,8 +218,11 @@ EOT
$self = $this; $self = $this;
$author = $io->askAndValidate( $author = $io->askAndValidate(
'Author [<comment>'.$author.'</comment>]: ', 'Author [<comment>'.$author.'</comment>, n to skip]: ',
function ($value) use ($self, $author) { function ($value) use ($self, $author) {
if ($value === 'n' || $value === 'no') {
return;
}
$value = $value ?: $author; $value = $value ?: $author;
$author = $self->parseAuthorString($value); $author = $self->parseAuthorString($value);