// Sort all modules by their lifecycle identifier and name.
uasort($uninstallable,
function D
$a,
$b) use ($unstable_lifecycle) { $lifecycle_a =
isset($unstable_lifecycle[$a->info
[ExtensionLifecycle::LIFECYCLE_IDENTIFIER
]]) ? -1 : 1;
$lifecycle_b =
isset($unstable_lifecycle[$b->info
[ExtensionLifecycle::LIFECYCLE_IDENTIFIER
]]) ? -1 : 1;
if ($lifecycle_a ===
$lifecycle_b) { return ModuleExtensionList::
sortByName($a,
$b);
} return $lifecycle_a <=>
$lifecycle_b;
});
$validation_reasons =
$this->moduleInstaller->
validateUninstall(array_keys($uninstallable));
$form['uninstall'
] =
['#tree' => TRUE
];
foreach ($uninstallable as $module_key =>
$module) { $name =
$module->info
['name'
] ?:
$module->
getName();
$form['modules'
][$module->
getName()]['#module_name'
] =
$name;
$form['modules'
][$module->
getName()]['name'
]['#markup'
] =
$name;
$form['modules'
][$module->
getName()]['description'
]['#markup'
] =
$this->
t($module->info
['description'
]);
$lifecycle =
$module->info
[ExtensionLifecycle::LIFECYCLE_IDENTIFIER
];
if ($lifecycle !== ExtensionLifecycle::STABLE && !
empty($module->info
[ExtensionLifecycle::LIFECYCLE_LINK_IDENTIFIER
])) { $form['modules'
][$module->
getName()]['name'
]['#markup'
] .= ' ' . Link::
fromTextAndUrl('(' .
$this->
t('@lifecycle',
['@lifecycle' =>
ucfirst($lifecycle)]) . ')',