];
// Sort all modules by their names.
try { // The module list needs to be reset so that it can re-scan and include
// any new modules that may have been added directly into the filesystem.
$modules =
$this->moduleExtensionList->
reset()->
getList();
// Remove obsolete modules.
$modules =
array_filter($modules,
function D
$module) { return !
$module->
isObsolete();
});
uasort($modules,
[ModuleExtensionList::
class, 'sortByName'
]);
} catch (InfoParserException
$e) { $this->
messenger()->
addError($this->
t('Modules could not be listed due to an error: %error',
['%error' =>
$e->
getMessage()]));
$modules =
[];
} // Iterate over each of the modules.
$form['modules'
]['#tree'
] = TRUE;
$incompatible_installed = FALSE;