src/Composer/ComposerJson.php
private function cleanEmptyArraysInPath($path)
    {
        $subs = $this->getEntries($path);
        if (!empty($subs)) {
            foreach ($subs as $subPath) {
                $this->cleanEmptyArraysInPath($subPath);
            }
        }

        if ([] === $this->get($path)) {
            $this->remove($path);
        }
    }
private function cleanEmptyArraysInPath($path)
    {
        $subs = $this->getEntries($path);
        if (!empty($subs)) {
            foreach ($subs as $subPath) {
                $this->cleanEmptyArraysInPath($subPath);
            }
        }

        if ([] === $this->get($path)) {
            $this->remove($path);
        }
    }
private function cleanEmptyArraysInPath ( $ path ) { $ subs = $ this -> getEntries ( $ path ) ; if ( ! empty ( $ subs ) ) { foreach ( $ subs as $ subPath ) { $ this -> cleanEmptyArraysInPath ( $ subPath ) ; } } if ( [ ] === $ this -> get ( $ path ) ) { $ this -> remove ( $ path ) ; } }
Cleanup the array section at the given path by removing empty sub arrays.

@param string $path The base path to remove empty elements from.

@return void
Cleanup the array section at the given path by removing empty sub arrays .