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>
main
Joseph Wynn 3 years ago committed by GitHub
parent f0d621e101
commit 44a2aa9be4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save