1
0
Fork 0

Fix TypeError (#10904)

Fix string type requirement in case of NULL value:

    [TypeError]                                                                                                                                                                  
    Composer\Command\InitCommand::parseAuthorString(): Argument #1 ($author) must be of type string, null given, called in phar:///composer.phar/src/Composer/Command/InitCommand.php on line 345
pull/10933/head
Tom Klingenberg 2022-07-01 11:15:29 +02:00 committed by GitHub
parent f7e88099af
commit 7ab4306c78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -342,7 +342,7 @@ EOT
return; return;
} }
$value = $value ?: $author; $value = $value ?: $author;
$author = $this->parseAuthorString($value); $author = $this->parseAuthorString($value ?? '');
if ($author['email'] === null) { if ($author['email'] === null) {
return $author['name']; return $author['name'];