// Go through each module in the list and try to install and uninstall
// it with its dependencies.
- while (list($name, $module) = each($all_modules)) {
+ foreach ($all_modules as $name => $module) {
$was_installed_list = \Drupal::moduleHandler()->getModuleList();
// Start a list of modules that we expect to be installed this time.