浏览代码

Merge pull request #7925 from localheinz/fix/empty

Fix: Remove empty node
Jordi Boggiano 6 年之前
父节点
当前提交
f599ebf55b
共有 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]);
+            }
         });
     }