From 7ab4306c7837a8b0ee239b292bfd5503ec36b857 Mon Sep 17 00:00:00 2001 From: Tom Klingenberg <352517+ktomk@users.noreply.github.com> Date: Fri, 1 Jul 2022 11:15:29 +0200 Subject: [PATCH] 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 --- src/Composer/Command/InitCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Command/InitCommand.php b/src/Composer/Command/InitCommand.php index ae8bc6c9b..a463c31de 100644 --- a/src/Composer/Command/InitCommand.php +++ b/src/Composer/Command/InitCommand.php @@ -342,7 +342,7 @@ EOT return; } $value = $value ?: $author; - $author = $this->parseAuthorString($value); + $author = $this->parseAuthorString($value ?? ''); if ($author['email'] === null) { return $author['name'];