Explorar o código

Fix: Remove empty node

Andreas Möller %!s(int64=6) %!d(string=hai) anos
pai
achega
ea333aa134
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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]);
+            }
         });
     }