source/Core/Module/ModuleExtensionsCleaner.php
protected function removeGarbage($installedExtensions, $garbage)
    {
        foreach ($garbage as $className => $classPaths) {
            foreach ($classPaths as $sClassPath) {
                if (isset($installedExtensions[$className])) {
                    unset($installedExtensions[$className][array_search($sClassPath, $installedExtensions[$className])]);
                    if (count($installedExtensions[$className]) == 0) {
                        unset($installedExtensions[$className]);
                    }
                }
            }
        }

        return $installedExtensions;
    }
protected function removeGarbage($installedExtensions, $garbage)
    {
        foreach ($garbage as $className => $classPaths) {
            foreach ($classPaths as $sClassPath) {
                if (isset($installedExtensions[$className])) {
                    unset($installedExtensions[$className][array_search($sClassPath, $installedExtensions[$className])]);
                    if (count($installedExtensions[$className]) == 0) {
                        unset($installedExtensions[$className]);
                    }
                }
            }
        }

        return $installedExtensions;
    }
protected function removeGarbage ( $ installedExtensions , $ garbage ) { foreach ( $ garbage as $ className => $ classPaths ) { foreach ( $ classPaths as $ sClassPath ) { if ( isset ( $ installedExtensions [ $ className ] ) ) { unset ( $ installedExtensions [ $ className ] [ array_search ( $ sClassPath , $ installedExtensions [ $ className ] ) ] ) ; if ( count ( $ installedExtensions [ $ className ] ) == 0 ) { unset ( $ installedExtensions [ $ className ] ) ; } } } } return $ installedExtensions ; }
Removes garbage - not exiting module extensions, returns clean array of installed extensions

@param array $installedExtensions all installed extensions ( from all modules )
@param array $garbage             extension which are not used and should be removed

@return array
Removes garbage - not exiting module extensions returns clean array of installed extensions