diff --git a/src/Composer/Command/ConfigCommand.php b/src/Composer/Command/ConfigCommand.php index 390cf2969..e893e7983 100644 --- a/src/Composer/Command/ConfigCommand.php +++ b/src/Composer/Command/ConfigCommand.php @@ -634,11 +634,6 @@ EOT if ($input->getOption('global') && (isset($uniqueProps[$settingKey]) || isset($multiProps[$settingKey]) || strpos($settingKey, 'extra.') === 0)) { throw new \InvalidArgumentException('The ' . $settingKey . ' property can not be set in the global config.json file. Use `composer global config` to apply changes to the global composer.json'); } - if ($input->getOption('unset') && (isset($uniqueProps[$settingKey]) || isset($multiProps[$settingKey]))) { - $this->configSource->removeProperty($settingKey); - - return 0; - } if (isset($uniqueProps[$settingKey])) { $this->handleSingleValue($settingKey, $uniqueProps[$settingKey], $values, 'addProperty'); @@ -801,6 +796,12 @@ EOT return 0; } + if ($input->getOption('unset')) { + $this->configSource->removeProperty($settingKey); + + return 0; + } + throw new \InvalidArgumentException('Setting '.$settingKey.' does not exist or is not supported by this command'); }