source/Core/Module/ModuleExtensionsCleaner.php
protected function getModuleExtensionsGarbage($moduleMetaDataExtensions, $moduleInstalledExtensions)
    {
        $garbage = $moduleInstalledExtensions;

        foreach ($garbage as $installedClassName => $installedClassPaths) {
            if (isset($moduleMetaDataExtensions[$installedClassName])) {
                // In case more than one extension is specified per module.
                $metaDataExtensionPaths = $moduleMetaDataExtensions[$installedClassName];
                if (!is_array($metaDataExtensionPaths)) {
                    $metaDataExtensionPaths = [$metaDataExtensionPaths];
                }

                foreach ($installedClassPaths as $index => $installedClassPath) {
                    if (in_array($installedClassPath, $metaDataExtensionPaths)) {
                        unset($garbage[$installedClassName][$index]);
                    }
                }

                if (count($garbage[$installedClassName]) == 0) {
                    unset($garbage[$installedClassName]);
                }
            }
        }

        return $garbage;
    }
protected function getModuleExtensionsGarbage($moduleMetaDataExtensions, $moduleInstalledExtensions)
    {
        $garbage = $moduleInstalledExtensions;

        foreach ($garbage as $installedClassName => $installedClassPaths) {
            if (isset($moduleMetaDataExtensions[$installedClassName])) {
                // In case more than one extension is specified per module.
                $metaDataExtensionPaths = $moduleMetaDataExtensions[$installedClassName];
                if (!is_array($metaDataExtensionPaths)) {
                    $metaDataExtensionPaths = [$metaDataExtensionPaths];
                }

                foreach ($installedClassPaths as $index => $installedClassPath) {
                    if (in_array($installedClassPath, $metaDataExtensionPaths)) {
                        unset($garbage[$installedClassName][$index]);
                    }
                }

                if (count($garbage[$installedClassName]) == 0) {
                    unset($garbage[$installedClassName]);
                }
            }
        }

        return $garbage;
    }
protected function getModuleExtensionsGarbage ( $ moduleMetaDataExtensions , $ moduleInstalledExtensions ) { $ garbage = $ moduleInstalledExtensions ; foreach ( $ garbage as $ installedClassName => $ installedClassPaths ) { if ( isset ( $ moduleMetaDataExtensions [ $ installedClassName ] ) ) { // In case more than one extension is specified per module. $ metaDataExtensionPaths = $ moduleMetaDataExtensions [ $ installedClassName ] ; if ( ! is_array ( $ metaDataExtensionPaths ) ) { $ metaDataExtensionPaths = [ $ metaDataExtensionPaths ] ; } foreach ( $ installedClassPaths as $ index => $ installedClassPath ) { if ( in_array ( $ installedClassPath , $ metaDataExtensionPaths ) ) { unset ( $ garbage [ $ installedClassName ] [ $ index ] ) ; } } if ( count ( $ garbage [ $ installedClassName ] ) == 0 ) { unset ( $ garbage [ $ installedClassName ] ) ; } } } return $ garbage ; }
Returns extension which is no longer in metadata - garbage

@param array $moduleMetaDataExtensions  extensions defined in metadata.
@param array $moduleInstalledExtensions extensions which are installed

@return array
Returns extension which is no longer in metadata - garbage