Explorar el Código

Merge pull request #7925 from localheinz/fix/empty

Fix: Remove empty node
Jordi Boggiano hace 6 años
padre
commit
f599ebf55b
Se han modificado 1 ficheros con 4 adiciones y 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]);
+            }
         });
     }