From ea333aa134ad36e104e2cb45c79093df4df67b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 28 Jan 2019 16:46:58 +0100 Subject: [PATCH] Fix: Remove empty node --- src/Composer/Config/JsonConfigSource.php | 4 ++++ 1 file changed, 4 insertions(+) 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]); + } }); }