You are here

private static function UnusedModulesHelperService::getAvailableModules in Unused Modules 8

Returns an array of available modules.

2 calls to UnusedModulesHelperService::getAvailableModules()
UnusedModulesHelperService::getEnabledModules in src/UnusedModulesHelperService.php
Returns an array of enabled modules.
UnusedModulesHelperService::getModulesByProject in src/UnusedModulesHelperService.php
Returns an array with all available modules.

File

src/UnusedModulesHelperService.php, line 50

Class

UnusedModulesHelperService
Common Unused Modules functionality.

Namespace

Drupal\unused_modules

Code

private static function getAvailableModules() {
  $available_modules =& drupal_static(__FUNCTION__);
  if (!isset($available_modules)) {
    $listing = new ExtensionDiscovery(\Drupal::root());
    $available_modules = array_map('self::decorateExtension', $listing
      ->scan('module'));

    // Remove core modules.
    self::removeCoreModules($available_modules);

    // Add information from .info file.
    self::addInfoFileInformation($available_modules);

    // Add project info.
    self::addProjectPath($available_modules);
  }
  return $available_modules;
}