From 53810b0cfbdd8127efeac956b70f3d4a029a83c1 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 16 Feb 2022 13:30:54 +0100 Subject: [PATCH] Fix return type --- src/Composer/Command/InitCommand.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Composer/Command/InitCommand.php b/src/Composer/Command/InitCommand.php index 11a19de26..30ef1fd0c 100644 --- a/src/Composer/Command/InitCommand.php +++ b/src/Composer/Command/InitCommand.php @@ -691,11 +691,16 @@ EOT /** * @param string $author * - * @return array + * @return array */ protected function formatAuthors($author) { - return array(array_filter($this->parseAuthorString($author), 'is_string')); + $author = $this->parseAuthorString($author); + if (null === $author['email']) { + unset($author['email']); + } + + return array($author); } /**