Skip to content

Commit

Permalink
Fix TypeError
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ktomk committed Jun 30, 2022
1 parent f7e8809 commit 740510e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Composer/Command/InitCommand.php
Expand Up @@ -342,7 +342,7 @@ function ($value) use ($author) {
return;
}
$value = $value ?: $author;
$author = $this->parseAuthorString($value);
$author = $this->parseAuthorString($value ?? '');

if ($author['email'] === null) {
return $author['name'];
Expand Down

0 comments on commit 740510e

Please sign in to comment.