瀏覽代碼

Fix: Remove empty node

Andreas Möller 6 年之前
父節點
當前提交
ea333aa134
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/Composer/Config/JsonConfigSource.php

+ 4 - 0
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]);
+            }
         });
     }