diff --git a/src/Composer/Config/JsonConfigSource.php b/src/Composer/Config/JsonConfigSource.php index 128ebf8ec..15d40d200 100644 --- a/src/Composer/Config/JsonConfigSource.php +++ b/src/Composer/Config/JsonConfigSource.php @@ -193,6 +193,10 @@ class JsonConfigSource implements ConfigSourceInterface { $this->manipulateJson('removeSubNode', $type, $name, function (&$config, $type, $name) { unset($config[$type][$name]); + + if (0 === count($config[$type])) { + unset($config[$type]); + } }); }