1
0
Fork 0

Log when COMPOSER_AUTH environment variable is malformed, but do not throw an error. Fixes #10208. (#10209)

Co-authored-by: Joseph Wynn <joseph@wildlyinaccurate.com>
pull/10231/head
Joseph Wynn 2021-10-27 20:40:20 +13:00 committed by GitHub
parent f0d621e101
commit 44a2aa9be4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 6 deletions

View File

@ -230,14 +230,16 @@ class Factory
$authData = json_decode($composerAuthEnv, true); $authData = json_decode($composerAuthEnv, true);
if (null === $authData) { if (null === $authData) {
throw new \UnexpectedValueException('COMPOSER_AUTH environment variable is malformed, should be a valid JSON object'); if ($io) {
$io->writeError('<error>COMPOSER_AUTH environment variable is malformed, should be a valid JSON object</error>');
} }
} else {
if ($io && $io->isDebug()) { if ($io && $io->isDebug()) {
$io->writeError('Loading auth config from COMPOSER_AUTH'); $io->writeError('Loading auth config from COMPOSER_AUTH');
} }
$config->merge(array('config' => $authData)); $config->merge(array('config' => $authData));
} }
}
return $config; return $config;
} }