Pārlūkot izejas kodu

Fix: Remove empty node

Andreas Möller 6 gadi atpakaļ
vecāks
revīzija
ea333aa134
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  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]);
+            }
         });
     }